Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-17016

rename across projects incorrectly checks source parent directory

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • 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.

      Attachments

        Issue Links

          Activity

            [LU-17016] rename across projects incorrectly checks source parent directory
            pjones Peter Jones added a comment -

            Merged for 2.16

            pjones Peter Jones added a comment - Merged for 2.16

            "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

            gerrit Gerrit Updater added a comment - "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

            "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

            adilger Andreas Dilger added a comment - "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

            People

              adilger Andreas Dilger
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: