[LU-8801] ldiskfs quota accounting iterator is flawed Created: 04/Nov/16  Updated: 02/Feb/17  Resolved: 17/Dec/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.10.0

Type: Bug Priority: Minor
Reporter: Niu Yawei (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The ldiskfs quota accounting iterator is flawed, that'll result in some accounting entries being missed in the output of proc files (acct_user & acct_group).

This can be reproduced by:

  • Create a fresh filesystem;
  • Run the following script to generate large amount of accounting entries:
    #!/bin/bash
    for i in `seq 10000`; do
            touch /mnt/lustre/file_$i
            chown $i:$i /mnt/lustre/file_$i
    done
    
  • Verify proc file by: cat /proc/fs/lustre/osd-ldiskfs/lustre-MDT0000/quota_slave/acct_user; Some entries are missed in the output.


 Comments   
Comment by Gerrit Updater [ 04/Nov/16 ]

Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/23583
Subject: LU-8801 quota: fix ldiskfs accounting iterator
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: bcb301aad574beed8022b1d34dc2bab02c64ca5b

Comment by Niu Yawei (Inactive) [ 07/Nov/16 ]

Another problem is that reading acct_user/group will become extremely slow when the amount of id entries is large, because in each lprocfs_quota_seq_start(), we use it->next() to move the cursor to current the last processed position like this:

       while (offset--) {
               rc = iops->next(&lqp->lqp_env, it);
               if (rc != 0) /* Error or reach the end */
                       goto not_found;
       }

Which is quite time consuming when the accounting file getting large. I'll optimize it with above fix together.

Comment by Gerrit Updater [ 17/Dec/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/23583/
Subject: LU-8801 quota: fix ldiskfs accounting iterator
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 623b315f6ddf8aa6ef435aa405e371ba93d0454a

Comment by Peter Jones [ 17/Dec/16 ]

Landed for 2.10

Generated at Sat Feb 10 02:20:40 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.