public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: Fix the logic check for all quotas being turned off
@ 2013-07-10 23:00 Chandra Seetharaman
  2013-07-11 21:41 ` Ben Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Chandra Seetharaman @ 2013-07-10 23:00 UTC (permalink / raw)
  To: XFS mailing list


During the review of seperate pquota inode patches, David noticed
that the test to detect all quotas being turned off was
incorrect, and hence the block was not freeing all the quota
information.

The check made sense in Irix, but in Linux, quota is turned off
one at a time, which makes the test invalid for Linux.

This problem existed since XFS was ported to Linux.

David suggested to fix the problem by detecting when all quotas are
turned off by checking m_qflags.

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
 fs/xfs/xfs_qm_syscalls.c |    5 ++---
 fs/xfs/xfs_quota.h       |    8 --------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index a08801a..09a45af 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -198,10 +198,9 @@ xfs_qm_scall_quotaoff(
 	}
 
 	/*
-	 * If quotas is completely disabled, close shop.
+	 * If all quotas are completely turned off, close shop.
 	 */
-	if (((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET1) ||
-	    ((flags & XFS_MOUNT_QUOTA_ALL) == XFS_MOUNT_QUOTA_SET2)) {
+	if (mp->m_qflags == 0) {
 		mutex_unlock(&q->qi_quotaofflock);
 		xfs_qm_destroy_quotainfo(mp);
 		return (0);
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
index 40d508b..69e3edf 100644
--- a/fs/xfs/xfs_quota.h
+++ b/fs/xfs/xfs_quota.h
@@ -301,14 +301,6 @@ typedef struct xfs_qoff_logformat {
 	 (XFS_IS_PQUOTA_ON(mp) && \
 		(mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD) == 0))
 
-#define XFS_MOUNT_QUOTA_SET1	(XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
-				 XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
-				 XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD)
-
-#define XFS_MOUNT_QUOTA_SET2	(XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
-				 XFS_UQUOTA_CHKD|XFS_PQUOTA_ACCT|\
-				 XFS_PQUOTA_ENFD|XFS_PQUOTA_CHKD)
-
 #define XFS_MOUNT_QUOTA_ALL	(XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
 				 XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
 				 XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD|\
-- 
1.7.1



_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: Fix the logic check for all quotas being turned off
  2013-07-10 23:00 [PATCH] xfs: Fix the logic check for all quotas being turned off Chandra Seetharaman
@ 2013-07-11 21:41 ` Ben Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Myers @ 2013-07-11 21:41 UTC (permalink / raw)
  To: Chandra Seetharaman; +Cc: XFS mailing list

On Wed, Jul 10, 2013 at 06:00:36PM -0500, Chandra Seetharaman wrote:
> 
> During the review of seperate pquota inode patches, David noticed
> that the test to detect all quotas being turned off was
> incorrect, and hence the block was not freeing all the quota
> information.
> 
> The check made sense in Irix, but in Linux, quota is turned off
> one at a time, which makes the test invalid for Linux.
> 
> This problem existed since XFS was ported to Linux.
> 
> David suggested to fix the problem by detecting when all quotas are
> turned off by checking m_qflags.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>

This looks ok to me. 

Reviewed-by: Ben Myers <bpm@sgi.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-11 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 23:00 [PATCH] xfs: Fix the logic check for all quotas being turned off Chandra Seetharaman
2013-07-11 21:41 ` Ben Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox