Whamcloud - gitweb
LU-11656 llite: fetch default layout for a directory 09/36609/11
authorJian Yu <yujian@whamcloud.com>
Tue, 19 Nov 2019 22:19:24 +0000 (14:19 -0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 Dec 2019 03:27:10 +0000 (03:27 +0000)
commit3e8fa8a7396cd029cb0d7714a324343eed7f535e
tree56a50abaaa846e1d69600689f94d1e891973fb08
parent39bc38600ca4d993ad0c2bd95051946e79ac6890
LU-11656 llite: fetch default layout for a directory

For a directory that does not have trusted.lov xattr, the current
"lfs getstripe" will only print the stripe_count, stripe_size,
and stripe_index that are fetched from the /sys/fs/lustre/lov values.
It doesn't show the actual default layout that will be used when
new files will be created in that directory.

This patch fixes the above issue in ll_dir_getstripe_default() by
fetching the layout from root FID after ll_dir_get_default_layout()
returns -ENODATA from a directory that does not have trusted.lov xattr.

Change-Id: Icbf1f8f4fa5e5b8788217fcb0cfd24a3b80a27d9
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36609
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/dir.c
lustre/llite/llite_internal.h
lustre/llite/xattr.c
lustre/tests/sanity.sh