xfs_quota per project buggy?

Latest response

Hi,

I am running a similar test to the one visible below:
http://lists.debian.org/debian-user/2011/09/msg00384.html
and I establish that the xfs_quota command may not to be trusted,
at least not for daily operations with project quota (see report below):

  • after an mv operation of a file between 2 projects, the accounting is plainly wrong

Can you reproduce the bug? do you agree it exists?

tia,
Fotis

[root@block103 ~]# dd if=/dev/zero of=/root/file.xfs bs=1M count=100
[root@block103 ~]# mkdir /media/mount.xfs
[root@block103 ~]# mount -o loop,prjquota /root/file.xfs /media/mount.xfs
[root@block103 ~]# mkdir /media/mount.xfs/dirA /media/mount.xfs/dirB
[root@block103 ~]# echo 1:/media/mount.xfs/dirA >> /etc/projects
[root@block103 ~]# echo 2:/media/mount.xfs/dirB >> /etc/projects
[root@block103 ~]# echo prjDirA:1 >> /etc/projid
[root@block103 ~]# echo prjDirB:2 >> /etc/projid
[root@block103 ~]# xfs_quota -x -c 'project -s prjDirA' /media/mount.xfs
Setting up project prjDirA (path /media/mount.xfs/dirA)...
Processed 1 (/etc/projects and cmdline) paths for project prjDirA with recursion depth infinite (-1).
[root@block103 ~]# xfs_quota -x -c 'project -s prjDirB' /media/mount.xfs
Setting up project prjDirB (path /media/mount.xfs/dirB)...
Processed 1 (/etc/projects and cmdline) paths for project prjDirB with recursion depth infinite (-1).
[root@block103 ~]# xfs_quota -x -c 'limit -p bhard=20m prjDirA' /media/mount.xfs
[root@block103 ~]# xfs_quota -x -c 'limit -p bhard=20m prjDirB' /media/mount.xfs
[root@block103 ~]# xfs_quota -x -c report /media/mount.xfs
Project quota on /media/mount.xfs (/dev/loop0)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
prjDirA             0          0      20480     00 [--------]
prjDirB             0          0      20480     00 [--------]

[root@block103 ~]# dd if=/dev/zero of=/media/mount.xfs/dirA/5Mo.file bs=1M count=5 ### CREATE file
5+0 records in
5+0 records out
5242880 bytes (5.2 MB) copied, 0.00756329 s, 693 MB/s
[root@block103 ~]# xfs_quota -x -c report /media/mount.xfs
Project quota on /media/mount.xfs (/dev/loop0)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
prjDirA             0          0      20480     00 [--------]
prjDirB             0          0      20480     00 [--------]

[root@block103 ~]# du -sh /media/mount.xfs/dirA
5.0M    /media/mount.xfs/dirA
[root@block103 ~]# xfs_quota -x -c report /media/mount.xfs
Project quota on /media/mount.xfs (/dev/loop0)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
prjDirA          5120          0      20480     00 [--------]
prjDirB             0          0      20480     00 [--------]

[root@block103 ~]# mv /media/mount.xfs/dirA/5Mo.file /media/mount.xfs/dirB/ ### MOVE file from one project to another
[root@block103 ~]# xfs_quota -x -c report /media/mount.xfs
Project quota on /media/mount.xfs (/dev/loop0)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
prjDirA             0          0      20480     00 [--------]
prjDirB             0          0      20480     00 [--------] ### <-- WHY ZERO???

And more importantly, why both zero? that means no ability for atomic operation as regards quota,
so it opens a can of worms.

Responses

Hi Fotis. Sorry you haven't seen a response yet on this. I'm asking our internal xfs experts to chek this out. Stay tuned.

ok, it seems that using sync treats the above example.

But the question still remains, as per possible article
"Why xfs_quota misreport project space in RHEL?"
https://access.redhat.com/site/solutions/505083

So, is the answer yes or no and for which RHEL versions?

Hello Fotis,

The article is an internal one and talks about the 'sync' solution for this specific problem. I hope that you've got a list of articles which talks about other fixed issues in xfs/nfs. Do you have any other queries ?

Vimal