public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] quota: don't disable accounting with quotaoff
@ 2010-06-11 22:09 Eric Sandeen
  2010-06-14 10:10 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2010-06-11 22:09 UTC (permalink / raw)
  To: Jan Kara; +Cc: xfs-oss

The quotaon(8) man page says:

NOTES ON XFS FILESYSTEMS
...
       To turn off quota limit enforcement on any XFS filesys-
       tem, first make sure that quota accounting and enforce-
       ment  are  both turned on using repquota -v filesystem.
       Then, use  quotaoff  -v  filesystem  to  disable  limit
       enforcement.   This may be done while the filesystem is
       mounted.

       Turning on quota limit enforcement on an XFS filesystem
       is  achieved  using quotaon -v filesystem.  This may be
       done while the filesystem is mounted

however, quotaoff turns off both enforcement -and- accounting,
and then quotaon fails.

If the manpage describes the intended behavior, then I think the
following patch is needed.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

--- quota-tools/quotaon_xfs.c	2010-01-05 10:39:54.000000000 -0500
+++ quota-tools-mine/quotaon_xfs.c	2010-06-11 17:45:12.000000000 -0400
@@ -208,10 +208,9 @@
 	}
 #endif /* XFS_ROOTHACK */
 
-	if (xarg == NULL) {	/* both acct & enfd on/off */
-		xopts |= (type == USRQUOTA) ?
-			(XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_UDQ_ENFD) :
-			(XFS_QUOTA_GDQ_ACCT | XFS_QUOTA_GDQ_ENFD);
+	if (xarg == NULL) {	/* only enfd on/off */
+		xopts |= (type == USRQUOTA) ? XFS_QUOTA_UDQ_ENFD :
+			XFS_QUOTA_GDQ_ENFD;
 		err = xfs_onoff((char *)dev, type, flags, roothack, xopts);
 	}
 	else if (strcmp(xarg, "account") == 0) {

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

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

* Re: [PATCH] quota: don't disable accounting with quotaoff
  2010-06-11 22:09 [PATCH] quota: don't disable accounting with quotaoff Eric Sandeen
@ 2010-06-14 10:10 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2010-06-14 10:10 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

  Hi,

On Fri 11-06-10 17:09:14, Eric Sandeen wrote:
> The quotaon(8) man page says:
> 
> NOTES ON XFS FILESYSTEMS
> ...
>        To turn off quota limit enforcement on any XFS filesys-
>        tem, first make sure that quota accounting and enforce-
>        ment  are  both turned on using repquota -v filesystem.
>        Then, use  quotaoff  -v  filesystem  to  disable  limit
>        enforcement.   This may be done while the filesystem is
>        mounted.
> 
>        Turning on quota limit enforcement on an XFS filesystem
>        is  achieved  using quotaon -v filesystem.  This may be
>        done while the filesystem is mounted
> 
> however, quotaoff turns off both enforcement -and- accounting,
> and then quotaon fails.
> 
> If the manpage describes the intended behavior, then I think the
> following patch is needed.
  Yes, I think this behavior makes more sence. Applied.

								Honza
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> --- quota-tools/quotaon_xfs.c	2010-01-05 10:39:54.000000000 -0500
> +++ quota-tools-mine/quotaon_xfs.c	2010-06-11 17:45:12.000000000 -0400
> @@ -208,10 +208,9 @@
>  	}
>  #endif /* XFS_ROOTHACK */
>  
> -	if (xarg == NULL) {	/* both acct & enfd on/off */
> -		xopts |= (type == USRQUOTA) ?
> -			(XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_UDQ_ENFD) :
> -			(XFS_QUOTA_GDQ_ACCT | XFS_QUOTA_GDQ_ENFD);
> +	if (xarg == NULL) {	/* only enfd on/off */
> +		xopts |= (type == USRQUOTA) ? XFS_QUOTA_UDQ_ENFD :
> +			XFS_QUOTA_GDQ_ENFD;
>  		err = xfs_onoff((char *)dev, type, flags, roothack, xopts);
>  	}
>  	else if (strcmp(xarg, "account") == 0) {
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

_______________________________________________
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:[~2010-06-14 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-11 22:09 [PATCH] quota: don't disable accounting with quotaoff Eric Sandeen
2010-06-14 10:10 ` Jan Kara

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