[LU-15200] "lfs getdirstripe -D subdir" does not show correct inherited layout Created: 09/Nov/21  Updated: 22/Jun/22  Resolved: 26/Jan/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Lai Siyao
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-14792 DNE3: enable filesystem-wide default LMV Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The default directory layout printed for non-root directories does not correctly show the actual layout specified on the root directory:

# lfs getdirstripe -D /mnt/testfs
lmv_stripe_count: 1 lmv_stripe_offset: -1 lmv_hash_type: none lmv_max_inherit: -1 lmv_max_inherit_rr: 3
# lfs getdirstripe -D /mnt/testfs/etc 
lmv_stripe_count: 0 lmv_stripe_offset: -1 lmv_hash_type: none lmv_max_inherit: -1 lmv_max_inherit_rr: 0
# getfattr -d -m - -e hex /mnt/testfs /mnt/testfs/etc
# file: mnt/testfs
trusted.dmv=0xd00cd30c01000000ffffffff000000000000000000030000000000000000000000000000000000000000000000000000
trusted.lma=0x000000000000000007000000020000000100000000000000
# file: mnt/testfs/etc
trusted.link=0xdff1ea11010000002d000000000000000000000000000000001500000002000000070000000100000000657463
trusted.lma=0x000000000000000002040000020000000100000000000000

The default directory layout stored on the root directory is printed properly, and is correctly inherited by actual subdirectories created in the filesystem, but this is not what is shown by "lfs getdirstripe -D" on the client. It is printing a "generic" default layout if no trusted.lmv xattr is found.

Instead, it would be more correct to return the inherited trusted.lmv from the root directory, if it exists and the lmv_max_inherit depth allows it, along with reducing lmv_max_inherit and lmv_max_inherit_rr by lli_depth if they are not -1.



 Comments   
Comment by Andreas Dilger [ 09/Nov/21 ]

It looks like ll_dir_getstripe_default() is specifically excluding fetching the default LMV, but it should do that since LU-14792 now has a filesystem-wide default directory layout for the filesystem on the root directory.

Comment by Gerrit Updater [ 15/Nov/21 ]

"Lai Siyao <lai.siyao@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45570
Subject: LU-15200 llite: "lfs getdirstripe -D" shows inherit layout
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 3bb59e4ffa2e877eeb3ceb24dc848b54f0a7dbfb

Comment by Gerrit Updater [ 18/Nov/21 ]

"Lai Siyao <lai.siyao@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45599
Subject: LU-15200 llite: revalidate dentry if LOOKUP lock fetched
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 88c7ef277631143e39c7eeb0a49dbbc33aa38f3a

Comment by Gerrit Updater [ 11/Jan/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45599/
Subject: LU-15200 llite: revalidate dentry if LOOKUP lock fetched
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 92fadf9cc1d06b21b482a262ff66f435814a13f8

Comment by Gerrit Updater [ 26/Jan/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45570/
Subject: LU-15200 llite: "lfs getdirstripe -D" shows inherit layout
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 61b1fad9e3fb21edcc0e713c89a3bfaeba9c883e

Comment by Peter Jones [ 26/Jan/22 ]

Landed for 2.15

Generated at Sat Feb 10 03:16:18 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.