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

create remote directory does not accept mode or handle umask properly

Details

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

    Description

      The LL_IOC_LMV_SETSTRIPE does not accept a mode for the directory to be created. Moreover umask is not handled in a way consistent with mkdir().

      static int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump,
                                     const char *filename)
      
      {
              ...
              mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR;
      }
      
      t:lustre# umask 0777
      t:lustre# mkdir d0
      t:lustre# stat d0
        File: `d0'
        Size: 4096      	Blocks: 8          IO Block: 4096   directory
      Device: 2c54f966h/743766374d	Inode: 216172799293652997  Links: 2
      Access: (0000/d---------)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2014-04-18 20:36:53.000000000 -0500
      Modify: 2014-04-18 20:36:53.000000000 -0500
      Change: 2014-04-18 20:36:53.000000000 -0500
      t:lustre# lfs mkdir -c4 d1
      t:lustre# stat d1
        File: `d1'
        Size: 16384     	Blocks: 8          IO Block: 4096   directory
      Device: 2c54f966h/743766374d	Inode: 216172799293652998  Links: 2
      Access: (0000/d---------)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2014-04-18 20:37:00.000000000 -0500
      Modify: 2014-04-18 20:37:00.000000000 -0500
      Change: 2014-04-18 20:37:00.000000000 -0500
      t:lustre# 
      t:lustre# umask 0000
      t:lustre# rmdir d0 d1
      t:lustre# 
      t:lustre# mkdir d0
      t:lustre# lfs mkdir -c4 d1
      t:lustre# stat d0
        File: `d0'
        Size: 4096      	Blocks: 8          IO Block: 4096   directory
      Device: 2c54f966h/743766374d	Inode: 216172799293652999  Links: 2
      Access: (0777/drwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2014-04-18 20:37:31.000000000 -0500
      Modify: 2014-04-18 20:37:31.000000000 -0500
      Change: 2014-04-18 20:37:31.000000000 -0500
      t:lustre# stat d1
        File: `d1'
        Size: 16384     	Blocks: 8          IO Block: 4096   directory
      Device: 2c54f966h/743766374d	Inode: 216172799293653000  Links: 2
      Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2014-04-18 20:37:37.000000000 -0500
      Modify: 2014-04-18 20:37:37.000000000 -0500
      Change: 2014-04-18 20:37:37.000000000 -0500
      

      Attachments

        Issue Links

          Activity

            [LU-4929] create remote directory does not accept mode or handle umask properly
            pjones Peter Jones made changes -
            Labels Original: dne2 mn4 mq414 New: dne2 mn4
            pjones Peter Jones made changes -
            Labels Original: dne2 mn4 mq314 New: dne2 mn4 mq414
            pjones Peter Jones made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
            pjones Peter Jones added a comment -

            Landed for 2.6

            pjones Peter Jones added a comment - Landed for 2.6
            di.wang Di Wang added a comment - http://review.whamcloud.com/10643
            pjones Peter Jones made changes -
            Priority Original: Major [ 3 ] New: Critical [ 2 ]
            pjones Peter Jones added a comment -

            Raising priority to ensure man page update gets in ahead of the release

            pjones Peter Jones added a comment - Raising priority to ensure man page update gets in ahead of the release

            Yes, if this affects remote directories also then it should be backported to b2_4 and b2_5.

            The reason that the bug was reopened was because the man page also needs to be updated for master. The backport is tracked separately.

            adilger Andreas Dilger added a comment - Yes, if this affects remote directories also then it should be backported to b2_4 and b2_5. The reason that the bug was reopened was because the man page also needs to be updated for master. The backport is tracked separately.
            di.wang Di Wang added a comment - - edited

            Ah, umask is not working properly for remote directory on 2.4 and 2.5 neither. And also I thought we want to support this -m mode specification for remote directory (or not?). I actually want to say we need different test-cases for 2.4 and 2.5, but it seems just useless and bring confusing, because we do not have striped dir on 2.4 and 2.5 anyway.

            di.wang Di Wang added a comment - - edited Ah, umask is not working properly for remote directory on 2.4 and 2.5 neither. And also I thought we want to support this -m mode specification for remote directory (or not?). I actually want to say we need different test-cases for 2.4 and 2.5, but it seems just useless and bring confusing, because we do not have striped dir on 2.4 and 2.5 anyway.
            adilger Andreas Dilger made changes -
            Summary Original: create striped directory does not accept mode or handle umask properly New: create remote directory does not accept mode or handle umask properly

            People

              di.wang Di Wang
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: