[LU-15070] client does not inherit default directory layout if changed Created: 06/Oct/21  Updated: 29/Nov/21  Resolved: 03/Nov/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.0
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-7357 Add layout lock for striped directories. Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

If a directory is created and a default directory layout is added to it, the client is not aware that the new default layout exists because of the xattr cache, so the client does not take this into account when creating the directory.

This can be seen clearly by setting a round-robin default layout on a directory below the normal 3-level round-robin default root layout, but I suspect it is always true:

# mkdir -p /mnt/testfs/rr1/rr2/rr3/sub4
# lfs setdirstripe -D -c 1 -i -1 --max-inherit-rr=3 /mnt/testfs/rr1/rr2/rr3/sub4
# mkdir /mnt/testfs/rr1/rr2/rr3/sub4/d{1..64}
# lfs getdirstripe -m /mnt/testfs/rr1/rr2/rr3/sub4/d{1..64} | sort | uniq -c
     64 1
# lctl set_param ldlm.namespaces.*.lru_size=clear
# mkdir /mnt/testfs/rr1/rr2/rr3/sub4/dd{1..64}
# lfs getdirstripe -m /mnt/testfs/rr1/rr2/rr3/sub4/dd{1..64} | sort | uniq -c
      16 0
      16 1
      16 2
      16 3

The default layout itself is inherited by the d* and dd* directories, because this is done locally to the MDT, but the decision to do round-robin allocation (and other directory default layouts) is not seen by the client until the directory lock/inode is cancelled and refreshed from the MDT.

When "lfs setdirstripe -D" is run on the MDS, it should revoke the MDS_INODELOCK_XATTR lock bit from this directory on all clients, and the client doing this operation itself should include this lock for ELC along with the RPC.



 Comments   
Comment by Lai Siyao [ 08/Oct/21 ]

Strange I can't reproduce this on master and exa6 code, even if I copied the script and run.

According to the code, when default LMV is set, MDT will revoke XATTR|LOOKUP lock.

Comment by Gerrit Updater [ 14/Oct/21 ]

"Lai Siyao <lai.siyao@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45236
Subject: LU-15070 mdt: set default LMV for remote dir
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: cd891b3dfbc47de9868d85b4d514ee97124ad2a5

Comment by Gerrit Updater [ 14/Oct/21 ]

"Lai Siyao <lai.siyao@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45237
Subject: LU-15070 llite: update default LMV upon any change
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: affdfbd78befddf7d25b7609ab78d207b093c4b0

Comment by Gerrit Updater [ 03/Nov/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45236/
Subject: LU-15070 mdt: revoke remote LOOKUP lock for default LMV
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b4645b5469c0722fdf66697379be878c071839cf

Comment by Gerrit Updater [ 03/Nov/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45237/
Subject: LU-15070 llite: update default LMV upon any change
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f3314706b4e5c21f14908650decd92a30fdc1db9

Comment by Peter Jones [ 03/Nov/21 ]

Landed for 2.15

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