quota: turn quotas off when remounting read-only
authorJan Kara <jack@suse.cz>
Fri, 8 Feb 2008 12:22:13 +0000 (04:22 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 8 Feb 2008 17:22:44 +0000 (09:22 -0800)
Turn off quotas before filesystem is remounted read only.  Otherwise quota
will try to write to read-only filesystem which does no good...  We could
also just refuse to remount ro when quota is enabled but turning quota off
is consistent with what we do on umount.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/super.c

index 65f6849847f4cf71fe700792dc45fa69efb5ac92..88811f60c8de517829ce7828c1971bfb4f90d8a1 100644 (file)
@@ -604,6 +604,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
                        mark_files_ro(sb);
                else if (!fs_may_remount_ro(sb))
                        return -EBUSY;
+               DQUOT_OFF(sb);
        }
 
        if (sb->s_op->remount_fs) {