[LU-17016] rename across projects incorrectly checks source parent directory Created: 04/Aug/23  Updated: 08/Feb/24  Resolved: 04/Feb/24

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.16.0, Lustre 2.15.4
Fix Version/s: None

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

Issue Links:
Related
is related to LU-13176 rename() to another directory should ... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

When renaming a directory between two different projects, in addition to (correctly) checking whether the source and target directories have the same projid, mdd_rename_sanity_check() incorrectly checks whether the source parent directory projid matches that of the target, even if the source directory itself has been changed to have the same projid as the target:

       if ((((tpattr->la_flags & LUSTRE_PROJINHERIT_FL) &&
           tpattr->la_projid != cattr->la_projid) ||
           ((pattr->la_flags & LUSTRE_PROJINHERIT_FL) &&
           (pattr->la_projid != tpattr->la_projid))) &&
           S_ISDIR(cattr->la_mode))
                RETURN(-EXDEV);

This EXDEV return incorrectly triggers mv to recursively recreate the directory tree on the target directory, but (at least since LU-13176 was fixed) the rename() of the files themselves is still successful and does not result in the file data also being copied.

This check of the parent projid/PROJINHERIT flag should be removed. There is no similar check in ext4_rename() for the source parent directory matching that of the target.



 Comments   
Comment by Andreas Dilger [ 04/Aug/23 ]

"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51868
Subject: LU-17016 mdd: no EXDEV for parent dir projid mismatch
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fda08e8537ada3429cee5750e07c02fbab64eae1

Comment by Gerrit Updater [ 04/Feb/24 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51868/
Subject: LU-17016 mdd: no EXDEV for parent dir projid mismatch
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 1c033467317394d18a7aa05f6e81734bcbbcac75

Comment by Peter Jones [ 04/Feb/24 ]

Merged for 2.16

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