Whamcloud - gitweb
LU-13062 llite: return stripe_offset -1 in trusted.lov 52/45252/10
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 15 Oct 2021 02:31:48 +0000 (20:31 -0600)
committerOleg Drokin <green@whamcloud.com>
Sun, 24 Nov 2024 06:02:57 +0000 (06:02 +0000)
commit25240a4146e9d57b22cee0c3f117a6ab46c5bd71
tree1c3f0bfb571434aae45d90d01656ea86836f65a2
parentcdb8b380cc5b6dadbc801cf9420c70036723d325
LU-13062 llite: return stripe_offset -1 in trusted.lov

If the trusted.lov xattr is copied by userspace to be restored later,
this results in PFL files always being restored onto OST0000 because
the kernel replaces the lmm_layout_gen field with 0 to avoid confusion
in userspace between the layout generation and the stripe offset (both
use the same field, one for input, one for output).

Instead of always returning 0 for the layout generation, return -1
for PFL layouts, so that restoring the xattr will direct the MDS to
select an appropriate OST.

For setxattr attempt patch prevent setting specific offsets if
PFL layout has an initialized entry what is considered as layout
copy attempt.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ia1af2bfcfa41cf1593aab44fe2fa792c3d254035
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/45252
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/xattr.c
lustre/tests/sanity-flr.sh
lustre/tests/sanity.sh