generic: test GETNEXTQUOTA near INT_MAX

XFS kernel code had a bug where GETNEXTQUOTA-type
quotactls requesting an ID near UINT_MAX could overflow
and return 0 as the "next" active ID.

This test checks that by creating an active quota near
UINT_MAX, then asking for the next one after it.

The proper answer is ENOENT, but if we wrap we'll return
ID 0.

This also changes test-nextquota.c so that it checks
both GETNEXTQUOTA and XGETNEXTQUOTA even if one fails;
it stores the failure conditions and returns 1 if either
of them fails.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eric Sandeen
2016-12-24 18:07:45 +08:00
committed by Eryu Guan
parent 716691159e
commit 3cbd329a14
4 changed files with 122 additions and 17 deletions
+8
View File
@@ -0,0 +1,8 @@
QA output created by 400
Launch all quotas
Ask for ID after 4294967293 expecting nothing
Q_GETNEXTQUOTA: No such file or directory
Q_XGETNEXTQUOTA: No such file or directory
Ask for ID after 4294967293 expecting nothing
Q_GETNEXTQUOTA: No such file or directory
Q_XGETNEXTQUOTA: No such file or directory