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

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

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved: