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

chown/chgrp doesn't work for files created by lfs setstripe

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.7.0
    • Lustre 2.6.0, Lustre 2.5.1, Lustre 2.4.3
    • 3
    • 13855

    Description

      This is easy to reproduce:

      • lfs setstripe -c 1 -i 0 /mnt/lustre/a
      • dd if=/dev/zero of=/mnt/lustre/a bs=1M count=1 conv=notrunc
      • chown $ID /mnt/lustre/a

      The uid on OST object will not be changed after chown.

      Look into the code osp_attr_set():

              /* new object, the very first ->attr_set()
               * initializing attributes needs no logging
               * all subsequent one are subject to the
               * logging and synchronization with OST */
              if (o->opo_new) {
                      o->opo_new = 0;
                      RETURN(0);
              }
      

      I don't quite see why this is necessary, but seems it'll break chown in above situation: OST object is created in 'dd' operation, and the first attr_set operation after create is the 'chown', and it's skipped.

      Attachments

        Issue Links

          Activity

            [LU-5006] chown/chgrp doesn't work for files created by lfs setstripe

            Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/14774
            Subject: LU-5006 mdd: don't call attr_set on object create
            Project: fs/lustre-release
            Branch: b2_4
            Current Patch Set: 1
            Commit: d0a2067981a16a1d536db3801d58328fbad2ff7e

            gerrit Gerrit Updater added a comment - Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/14774 Subject: LU-5006 mdd: don't call attr_set on object create Project: fs/lustre-release Branch: b2_4 Current Patch Set: 1 Commit: d0a2067981a16a1d536db3801d58328fbad2ff7e

            Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/14773
            Subject: LU-5006 mdd: don't call attr_set on object create
            Project: fs/lustre-release
            Branch: b2_5
            Current Patch Set: 1
            Commit: c79136559617ffd23415dab3d995e8aec994fab0

            gerrit Gerrit Updater added a comment - Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/14773 Subject: LU-5006 mdd: don't call attr_set on object create Project: fs/lustre-release Branch: b2_5 Current Patch Set: 1 Commit: c79136559617ffd23415dab3d995e8aec994fab0

            Ok, I'll port it soon.

            niu Niu Yawei (Inactive) added a comment - Ok, I'll port it soon.

            Can you cook up patches for 2.5.3 and 2.4.3, Niu? Cherry-picking resulted in big difference, especially in lustre/osp/osp_object.c.

            jaylan Jay Lan (Inactive) added a comment - Can you cook up patches for 2.5.3 and 2.4.3, Niu? Cherry-picking resulted in big difference, especially in lustre/osp/osp_object.c.

            Is this patch required for 2.5.3?

            Yes, 2.5.3 doesn't have this fix. If your application perform the commands like the reproducer does, it'll hit the problem.

            niu Niu Yawei (Inactive) added a comment - Is this patch required for 2.5.3? Yes, 2.5.3 doesn't have this fix. If your application perform the commands like the reproducer does, it'll hit the problem.

            Is this patch required for 2.5.3?

            mhanafi Mahmoud Hanafi added a comment - Is this patch required for 2.5.3?

            Patch landed to Master. Please reopen ticket if more work is needed.

            jlevi Jodi Levi (Inactive) added a comment - Patch landed to Master. Please reopen ticket if more work is needed.

            forgot to mention - sanity/103 does check ACLs very well, please make sure it passes with ldiskfs and ZFS.

            bzzz Alex Zhuravlev added a comment - forgot to mention - sanity/103 does check ACLs very well, please make sure it passes with ldiskfs and ZFS.

            please check mdd_acl_init() -> __mdd_fix_mode_acl(). it looks like the code was reorganized since that. the fingers are crossed for the testing

            bzzz Alex Zhuravlev added a comment - please check mdd_acl_init() -> __mdd_fix_mode_acl(). it looks like the code was reorganized since that. the fingers are crossed for the testing

            Thanks, Alex. I didn't see how default ACLs can change the object mode from code. (seems default ACLs is set after the additional attr_set call in current code). I cooked a patch to remove this additional attr_set: http://review.whamcloud.com/#/c/12243/

            niu Niu Yawei (Inactive) added a comment - Thanks, Alex. I didn't see how default ACLs can change the object mode from code. (seems default ACLs is set after the additional attr_set call in current code). I cooked a patch to remove this additional attr_set: http://review.whamcloud.com/#/c/12243/

            People

              niu Niu Yawei (Inactive)
              niu Niu Yawei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: