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

/usr/bin/touch removes the setgid bit on directories

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.6.0, Lustre 2.5.2
    • Lustre 2.6.0, Lustre 2.4.2
    • Centos 6.5/Debian 6 clients, DDN Exascaler servers.
    • 4
    • 13611

    Description

      MDS/OSS are running Centos 6.4 and Lustre 2.4.2. Clients also running 2.4.2.

      Calling "touch -a" to update the atime on a directory clears the setgid bit from that directory.

      Example:

      $ mkdir foo
      $ ls -ld foo
      drwxrwx--x 2 user user 4096 Apr 17 11:47 foo
      $ chgrp group foo
      ls -ld foo
      drwxrwx--x 2 user group 4096 Apr 17 11:47 foo
      $ chmod g+s foo
      $ ls -ld foo
      drwxrws--x 2 user group 4096 Apr 17 11:47 foo
      $ touch -a foo
      $ ls -ld foo
      drwxrwx--x 2 user group 4096 Apr 17 11:47 foo

      This is unexpected behavior, and seems like a bug. I don't get this behavior on local or NFS filesystems. If it's relevant, our identity_upcall setting is "NONE"

      Thanks,
      Peter

      Attachments

        Activity

          [LU-4924] /usr/bin/touch removes the setgid bit on directories
          bogl Bob Glossman (Inactive) added a comment - backport to b2_5: http://review.whamcloud.com/10405

          Fix landed to master

          utopiabound Nathaniel Clark added a comment - Fix landed to master

          With the Makefile.am change this time:
          http://review.whamcloud.com/10153

          utopiabound Nathaniel Clark added a comment - With the Makefile.am change this time: http://review.whamcloud.com/10153

          Patch 10071 was landed because it was marked Maloo +1, but this was unfortunately a lie due to TEI-1508, and it was actually failing its own test 100% of the time because the test script was missing from lustre/tests/Makefile.am, so was immediately reverted. Could you please submit a replacement patch (I suspect it will need to use a new ChangeId).

          adilger Andreas Dilger added a comment - Patch 10071 was landed because it was marked Maloo +1, but this was unfortunately a lie due to TEI-1508, and it was actually failing its own test 100% of the time because the test script was missing from lustre/tests/Makefile.am, so was immediately reverted. Could you please submit a replacement patch (I suspect it will need to use a new ChangeId).
          utopiabound Nathaniel Clark added a comment - http://review.whamcloud.com/10071

          Is there any new information to report back to the customer on this one? Thanks!

          orentas Oz Rentas (Inactive) added a comment - Is there any new information to report back to the customer on this one? Thanks!

          strace of "touch -a /mnt/testfs/foo" on master:

          open("/mnt/testfs/foo", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EISDIR (Is a directory)
          stat("/mnt/testfs/foo", {st_mode=S_IFDIR|S_ISGID|0775, st_size=4096, ...}) = 0
          utimensat(AT_FDCWD, "/mnt/testfs/foo", {UTIME_NOW, {1397756585, 0}}, 0) = 0
          
          adilger Andreas Dilger added a comment - strace of " touch -a /mnt/testfs/foo " on master: open("/mnt/testfs/foo", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EISDIR (Is a directory) stat("/mnt/testfs/foo", {st_mode=S_IFDIR|S_ISGID|0775, st_size=4096, ...}) = 0 utimensat(AT_FDCWD, "/mnt/testfs/foo", {UTIME_NOW, {1397756585, 0}}, 0) = 0

          I tested this locally on 2.4.2 and master with the default identity_upcall, and the problem is present in both versions.

          adilger Andreas Dilger added a comment - I tested this locally on 2.4.2 and master with the default identity_upcall, and the problem is present in both versions.

          Nathaniel,
          Could you please have a look at this one?
          Thank you!

          jlevi Jodi Levi (Inactive) added a comment - Nathaniel, Could you please have a look at this one? Thank you!

          People

            utopiabound Nathaniel Clark
            orentas Oz Rentas (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: