Skip to contentSkip to conversation

xfs: fix xfs_quota remove error

PATCH In review [email protected] 2 participants 2 messages Oct 22, 2009 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: fix xfs_quota remove error

Hi,

The xfs_quota returns ENOSYS when remove command is executed. My kernel version is 2.6.31 and xfsprogs version is 3.0.3. You can reproduce this issue with following steps.

    # mount -t xfs -o uquota /dev/sda7 /mnt/mp1
    # xfs_quota -x -c off -c remove
    XFS_QUOTARM: Function not implemented.

The remove command is allowed during quotaoff,
but xfs_xstate() checks whether quota is running, so it leads to ENOSYS.

To solve this problem, add conditional statement
that op is not X_QUOTARM with running check.

----
xfs_quotaops.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/linux-2.6/xfs_quotaops.c +1 -1
diff -Nrup a/fs/xfs/linux-2.6/xfs_quotaops.c b/fs/xfs/linux-2.6/xfs_quotaops.c
@@ -80,7 +80,7 @@ xfs_fs_set_xstate(
 
 	if (sb->s_flags & MS_RDONLY)
 		return -EROFS;
-	if (!XFS_IS_QUOTA_RUNNING(mp))
+	if (!XFS_IS_QUOTA_RUNNING(mp) && op != Q_XQUOTARM)
 		return -ENOSYS;
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;

Best regards,
Ryota Yamauchi

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 10 lines · On Thu, Oct 22, 2009 at 04:06:27PM +0900, [email protected] wrote:

Hi,

The xfs_quota returns ENOSYS when remove command is executed. My kernel version is 2.6.31 and xfsprogs version is 3.0.3. You can reproduce this issue with following steps.

    # mount -t xfs -o uquota /dev/sda7 /mnt/mp1
    # xfs_quota -x -c off -c remove
    XFS_QUOTARM: Function not implemented.
Quoted 6 lines

The remove command is allowed during quotaoff,
but xfs_xstate() checks whether quota is running, so it leads to ENOSYS.

To solve this problem, add conditional statement
that op is not X_QUOTARM with running check.

Thanks you, the patch looks correct. I will write an xfstests testcase based on your above report to make sure we can check for this regression in the future.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs