Commit 41dfe594 authored by Andreas Dilger's avatar Andreas Dilger Committed by Oleg Drokin
Browse files

LU-13687 llite: return -ENODATA if no default layout

Don't return -ENOENT if fetching the default layout from the root
directory fails.  Otherwise, "lfs find" will print an error message
for every directory scanned in the filesystem:

     lfs find: /myth/tmp does not exist: No such file or directory

Lustre-change: https://review.whamcloud.com/39200
Lustre-commit: 7fb17eb7

Fixes: 3e8fa8a7

 ("LU-11656 llite: fetch default layout for a directory")
Signed-off-by: default avatarAndreas Dilger <adilger@whamcloud.com>
Change-Id: I5e082c5d425c44ca7770d3b24cbb13bb7d2540e5
Reviewed-by: default avatarJian Yu <yujian@whamcloud.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40499

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
parent 8b014cbc
......@@ -776,10 +776,13 @@ int ll_dir_getstripe_default(struct inode *inode, void **plmm, int *plmm_size,
rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
&req, valid, 0);
if (rc == -ENODATA && !fid_is_root(ll_inode2fid(inode)) &&
!(valid & (OBD_MD_MEA|OBD_MD_DEFAULT_MEA)) && root_request != NULL)
rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
&root_req, valid,
GET_DEFAULT_LAYOUT_ROOT);
!(valid & (OBD_MD_MEA|OBD_MD_DEFAULT_MEA)) && root_request != NULL){
int rc2 = ll_dir_get_default_layout(inode, (void **)&lmm,
&lmm_size, &root_req, valid,
GET_DEFAULT_LAYOUT_ROOT);
if (rc2 == 0)
rc = 0;
}
*plmm = lmm;
*plmm_size = lmm_size;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment