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

e2fsck clears quota limits when error is found

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Lustre 2.4.0
    • 3
    • 6209

    Description

      On the ext4 call today I heard from Ted Ts'o that the e2fsck checking for the quota files is broken. Apparently, if there is an error in the quota accounting (e.g. blocks used for user_X in the quota file doesn't match actual blocks counted in inodes owned by user_x) then the whole quota file is rewritten from the in-memory quota table, but the quota limits are not saved. This can be checked by creating a filesystem with quotas, then use debugfs to delete some inodes with allocated data blocks (probably on the OST) and run e2fsck. This probably needs a test in sanity-quota.sh to verify the quota limits after debugfs + e2fsck have been run.

      A second problem is that the e2fsck quota code does not detect if there is a user that owns inodes/blocks but is not present in the on-disk quota file. If the quota file is somehow corrupted, the user will not have any assigned quota.

      This is discussed in the linux-ext4 thread with the subject how to quotacheck with the new quota implementation (hidden inode)? http://www.spinics.net/lists/linux-ext4/msg36077.html, so it would be good to check for any patches and/or reply to that thread if someone is going to start working on this.

      Attachments

        Activity

          [LU-2660] e2fsck clears quota limits when error is found

          Already fixed in upstream.

          niu Niu Yawei (Inactive) added a comment - Already fixed in upstream.

          The second problem has been fixed in upstream and already being included in our tree.

          Author: Theodore Ts'o <tytso@mit.edu>
          Date:   Sat May 10 01:27:31 2014 -0400
          
              quota: fix e2fsck to notice missing quota entries
          
              Previously if there was a missing quota entry --- i.e., if there were
              files owned by group "eng", but there was no quota record for group
              "eng", e2fsck would not notice the missing entry.  This means that the
              usage informtion would not be properly repaired.  This is unfortunate.
              Fix this by marking each quota record in quota_dict that has a
              corresponding record on disk, and then check to see if there are any
              records in quota_dict that have not been marked as having been seen.
              In that case, we know we need to update the relevant quota inode.
          
              Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
              Reviewed-by: Aditya Kali <adityakali@google.com>
          
          niu Niu Yawei (Inactive) added a comment - The second problem has been fixed in upstream and already being included in our tree. Author: Theodore Ts'o <tytso@mit.edu> Date: Sat May 10 01:27:31 2014 -0400 quota: fix e2fsck to notice missing quota entries Previously if there was a missing quota entry --- i.e., if there were files owned by group "eng" , but there was no quota record for group "eng" , e2fsck would not notice the missing entry. This means that the usage informtion would not be properly repaired. This is unfortunate. Fix this by marking each quota record in quota_dict that has a corresponding record on disk, and then check to see if there are any records in quota_dict that have not been marked as having been seen. In that case , we know we need to update the relevant quota inode. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Aditya Kali <adityakali@google.com>

          The first problem will not affect lustre, since we never set & use the limits in the local fs. I'll monitor the mail thread, and start work on the fix if there is spare time.

          niu Niu Yawei (Inactive) added a comment - The first problem will not affect lustre, since we never set & use the limits in the local fs. I'll monitor the mail thread, and start work on the fix if there is spare time.

          People

            niu Niu Yawei (Inactive)
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: