]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: handle wrapped id from GETNEXTQUOTA
authorEric Sandeen <sandeen@redhat.com>
Wed, 21 Dec 2016 05:21:19 +0000 (23:21 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 21 Dec 2016 05:21:19 +0000 (23:21 -0600)
commitebd6aa8b28878528f07fb1bf6c06a55600f3f783
tree2d664d1d328fc38945f2d9992016ce1b3618b993
parent8ebad4d47249d8540e3e46cbafde7eb70a06673b
xfs_quota: handle wrapped id from GETNEXTQUOTA

The GETNEXTQUOTA interface in the kernel had a bug
(at least in xfs) where if we pass in UINT_MAX as the
ID, it incremented, warpped, and returned 0 for the next
id.  This would cause userspace to start querying
again at zero, and an xfs_quota "report" command would
loop forever.  This occurred if a quota ID near
UINT max existed, and later offsets within the block
wrapped the xfs_dqid_t.

This will also be fixed in the kernel, but we should also
catch this in userspace, and stop the loop if it happens.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
quota/report.c