Whamcloud - gitweb
LU-11656 llite: fetch default layout for a directory 72/37072/3
authorJian Yu <yujian@whamcloud.com>
Tue, 19 Nov 2019 22:19:24 +0000 (14:19 -0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 3 Jan 2020 23:44:17 +0000 (23:44 +0000)
commitca373442fc15a6dc77dcce36e91847c58ac45c03
treee4b5ff998c7b7203a7e88e34b9ddd20e9947a592
parent5b1ea58c21edd17c2cb1f4ecdbbeb5bbdaa1444b
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.

Lustre-change: https://review.whamcloud.com/36609
Lustre-commit: 3e8fa8a7396cd029cb0d7714a324343eed7f535e

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