[Top] [All Lists]

[PATCH] xfs: fix xfs_quota remove error

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfs: fix xfs_quota remove error
From: r-yamauchi@xxxxxxxxxxxxx
Date: Thu, 22 Oct 2009 16:06:27 +0900
Reply-to: r-yamauchi@xxxxxxxxxxxxx

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.

Signed-off-by: Ryota Yamauchi <r-yamauchi@xxxxxxxxxxxxx>
Signed-off-by: Utako Kusaka <u-kusaka@xxxxxxxxxxxxx>

xfs_quotaops.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -Nrup a/fs/xfs/linux-2.6/xfs_quotaops.c b/fs/xfs/linux-2.6/xfs_quotaops.c
--- a/fs/xfs/linux-2.6/xfs_quotaops.c   2009-10-21 14:15:12.000000000 +0900
+++ b/fs/xfs/linux-2.6/xfs_quotaops.c   2009-10-21 14:16:04.000000000 +0900
@@ -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

<Prev in Thread] Current Thread [Next in Thread>