linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aditya Kali <adityakali@google.com>
To: tytso@mit.edu, johann@whamcloud.com, linux-ext4@vger.kernel.org
Cc: Aditya Kali <adityakali@google.com>
Subject: [PATCH 4/4] tune2fs: fix quota feature removal
Date: Fri, 13 Jul 2012 15:25:09 -0700	[thread overview]
Message-ID: <1342218309-25983-4-git-send-email-adityakali@google.com> (raw)
In-Reply-To: <1342218309-25983-1-git-send-email-adityakali@google.com>

When the last quota inode is removed, the 'quota' feature
flag was not removed from superblock in some cases.
Ex:
 $ mke2fs -t ext4 -O quota <dev>  # creates both usr & grp
                                  # quota inodes
 $ tune2fs -Q ^usrquota <dev>  # removes usr quota inode
 $ tune2fs -Q ^grpquota <dev>  # removes grp quota inode,
                               # but the 'quota' feature flag
                               # was not removed from superblock
This patch removes the 'quota' feature flag from superblock
if none of the quota inodes are set.

Signed-off-by: Aditya Kali <adityakali@google.com>
---
 misc/tune2fs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 73bc10c..fb46fb6 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -734,7 +734,8 @@ void handle_quota_options(ext2_filsys fs)
 	if ((usrquota == QOPT_ENABLE) || (grpquota == QOPT_ENABLE)) {
 		fs->super->s_feature_ro_compat |= EXT4_FEATURE_RO_COMPAT_QUOTA;
 		ext2fs_mark_super_dirty(fs);
-	} else if ((usrquota == QOPT_DISABLE) && (grpquota == QOPT_DISABLE)) {
+	} else if (!fs->super->s_usr_quota_inum &&
+		   !fs->super->s_grp_quota_inum) {
 		fs->super->s_feature_ro_compat &= ~EXT4_FEATURE_RO_COMPAT_QUOTA;
 		ext2fs_mark_super_dirty(fs);
 	}
-- 
1.7.7.3


  parent reply	other threads:[~2012-07-13 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 22:25 [PATCH 1/4] tune2fs/quota: always create hidden quota files Aditya Kali
2012-07-13 22:25 ` [PATCH 2/4] libquota: fix quota_inode_truncate() Aditya Kali
2012-07-13 22:25 ` [PATCH 3/4] e2fsck/quota: mark FS invalid if quotas are not fixed Aditya Kali
2012-07-13 22:25 ` Aditya Kali [this message]
2012-07-17  5:22 ` [PATCH 1/4] tune2fs/quota: always create hidden quota files Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342218309-25983-4-git-send-email-adityakali@google.com \
    --to=adityakali@google.com \
    --cc=johann@whamcloud.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).