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

quota exceeded returned when creating files with root user in directory where setgid is set

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.12.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Set setgid flag on the directory and set inode hard quota for the gruop.  
      # cd /lustre
      # mkdir aaa
      # chown test1:tes1 aaa
      # chmod g+s aaa
      # lfs setquota -g test1 -I 4096 /lustre
      
      With test1 group, create many files until quota exceeded occur.  
      # su - test1
      $ for i in `seq -w 0001 4096`; do touch ${i} ; done
      $ exit
      
      Then, with root user, create a directory. It returns quota exceeded error.  
      # mkdir bbb
      mkdir: cannot create directory ‘bbb’: Disk quota exceeded
      
      

      reason is Lustre try to check quota for file owner uid, gid and it will skip quota type check if this
      quota type id is 0.

      For setgid, even root user try touch a file, the file's group id will still inherit from its parents.
      So quota check will ignore user quota, but still enforce group quota for the file.

      The idea should be Like GPFS or ext4, that we pass CAP_SYS_RESOURCE down and use this
      to check whether we should skip quota.

      Attachments

        Activity

          [LU-11017] quota exceeded returned when creating files with root user in directory where setgid is set
          pjones Peter Jones made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          pjones Peter Jones added a comment -

          Landed for 2.12

           

          pjones Peter Jones added a comment - Landed for 2.12  

          Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/32378/
          Subject: LU-11017 quota: ignore quota for CAP_SYS_RESOURCE properly
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 8aa8a920efd7ed8f217563df84905f972a16ad85

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/32378/ Subject: LU-11017 quota: ignore quota for CAP_SYS_RESOURCE properly Project: fs/lustre-release Branch: master Current Patch Set: Commit: 8aa8a920efd7ed8f217563df84905f972a16ad85
          pjones Peter Jones made changes -
          Link Original: This issue is related to JFC-10 [ JFC-10 ]
          pjones Peter Jones made changes -
          Fix Version/s New: Lustre 2.12.0 [ 13495 ]
          mdiep Minh Diep made changes -
          Link New: This issue is related to JFC-10 [ JFC-10 ]
          pjones Peter Jones made changes -
          Assignee Original: WC Triage [ wc-triage ] New: Wang Shilong [ wangshilong ]
          pjones Peter Jones added a comment -

          Thanks Shillong

          pjones Peter Jones added a comment - Thanks Shillong

          Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/32378
          Subject: LU-11017 quota: ignore quota for CAP_SYS_RESOURCE properly
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 5b21175030fdd930ad273c4feeb10dbd16627609

          gerrit Gerrit Updater added a comment - Wang Shilong (wshilong@ddn.com) uploaded a new patch: https://review.whamcloud.com/32378 Subject: LU-11017 quota: ignore quota for CAP_SYS_RESOURCE properly Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 5b21175030fdd930ad273c4feeb10dbd16627609
          wangshilong Wang Shilong (Inactive) created issue -

          People

            wangshilong Wang Shilong (Inactive)
            wangshilong Wang Shilong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: