Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.16.0, Lustre 2.15.4
-
None
-
3
-
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.