xfs: test X_QUOTARM functionality
authorEric Sandeen <sandeen@redhat.com>
Tue, 22 Apr 2014 00:47:28 +0000 (10:47 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 22 Apr 2014 00:47:28 +0000 (10:47 +1000)
commitde876b996aa2ddc16328d93cbb6535c589087179
treea015f474e8d0788f6e74ec8b871dad99ae0889a2
parent35ee39228be394c66ec8c7d7702526861511ae9a
xfs: test X_QUOTARM functionality

The Q_XQUOTARM quotactl was not working properly, because
we weren't passing in proper flags.  The xfs_fs_set_xstate()
ioctl handler used the same flags for Q_XQUOTAON/OFF as
well as Q_XQUOTARM, but Q_XQUOTAON/OFF look for
XFS_UQUOTA_ACCT, XFS_UQUOTA_ENFD, XFS_GQUOTA_ACCT etc,
i.e. quota type + state, while Q_XQUOTARM looks only for
the type of quota, i.e. XFS_DQ_USER, XFS_DQ_GROUP etc.

Unfortunately these flag spaces overlap a bit, so we
got semi-random results for Q_XQUOTARM; i.e. the value
for XFS_DQ_USER == XFS_UQUOTA_ACCT, etc.  yeargh.

Anyway, here's a simple test that demonstrates it,
kernel patch to fix it will follow.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/xfs/007 [new file with mode: 0755]
tests/xfs/007.out [new file with mode: 0644]
tests/xfs/group