Skip to contentSkip to conversation

quota: don't disable accounting with quotaoff

PATCH In review Eric Sandeen 2 participants 2 messages Jun 11, 2010 – Jun 14, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 quota: don't disable accounting with quotaoff

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.

---

quotaon_xfs.c +3 -4
@@ -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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

Hi,

Quoted 15 lines · Eric Sandeen

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

Quoted 5 lines

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

Quoted 21 lines

---

quotaon_xfs.c +3 -4
@@ -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) {
Signature · 7 lines
Jan Kara <[email protected]>
SUSE Labs, CR

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