From: Aditya Kali Date: Fri, 13 Jul 2012 22:25:09 +0000 (-0700) Subject: tune2fs: fix quota feature removal X-Git-Tag: v1.42.5~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89dd15db9fbcf289afca24751fb463245c5c6aee;p=thirdparty%2Fe2fsprogs.git tune2fs: fix quota feature removal 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 # creates both usr & grp # quota inodes $ tune2fs -Q ^usrquota # removes usr quota inode $ tune2fs -Q ^grpquota # 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 Signed-off-by: Theodore Ts'o --- diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 73bc10c0a..fb46fb6d1 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); }