diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-05-19 13:16:40 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-24 14:06:39 +0200 |
commit | c79d967de3741ceb60c5bbbf1b6f97eab9a89838 (patch) | |
tree | 5494e7b504cffb0ddc6942d1542c2b4a472207ed /fs/ext4 | |
parent | ocfs2: Fix use after free on remount read-only (diff) | |
download | linux-c79d967de3741ceb60c5bbbf1b6f97eab9a89838.tar.xz linux-c79d967de3741ceb60c5bbbf1b6f97eab9a89838.zip |
quota: move remount handling into the filesystem
Currently do_remount_sb calls into the dquot code to tell it about going
from rw to ro and ro to rw. Move this code into the filesystem to
not depend on the dquot code in the VFS - note ocfs2 already ignores
these calls and handles remount by itself. This gets rid of overloading
the quotactl calls and allows to unify the VFS and XFS codepaths in
that area later.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e14d22c170d5..fb1e191d0fa9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3574,6 +3574,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) ext4_fsblk_t n_blocks_count = 0; unsigned long old_sb_flags; struct ext4_mount_options old_opts; + int enable_quota = 0; ext4_group_t g; unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; int err; @@ -3630,6 +3631,12 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) } if (*flags & MS_RDONLY) { + err = vfs_dq_off(sb, 1); + if (err < 0 && err != -ENOSYS) { + err = -EBUSY; + goto restore_opts; + } + /* * First of all, the unconditional stuff we have to do * to disable replay of the journal when we next remount @@ -3698,6 +3705,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) goto restore_opts; if (!ext4_setup_super(sb, es, 0)) sb->s_flags &= ~MS_RDONLY; + enable_quota = 1; } } ext4_setup_system_zone(sb); @@ -3713,6 +3721,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) #endif unlock_super(sb); unlock_kernel(); + if (enable_quota) + vfs_dq_quota_on_remount(sb); return 0; restore_opts: |