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/udf/super.c | |
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/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 1e4543cbcd27..9ab4e259404b 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -54,6 +54,7 @@ #include <linux/vmalloc.h> #include <linux/errno.h> #include <linux/mount.h> +#include <linux/quotaops.h> #include <linux/seq_file.h> #include <linux/bitmap.h> #include <linux/crc-itu-t.h> @@ -557,6 +558,7 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options) { struct udf_options uopt; struct udf_sb_info *sbi = UDF_SB(sb); + int error = 0; uopt.flags = sbi->s_flags; uopt.uid = sbi->s_uid; @@ -582,17 +584,26 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options) *flags |= MS_RDONLY; } - if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { - unlock_kernel(); - return 0; - } - if (*flags & MS_RDONLY) + if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) + goto out_unlock; + + if (*flags & MS_RDONLY) { udf_close_lvid(sb); - else + + error = vfs_dq_off(sb, 1); + if (error < 0 && error != -ENOSYS) + error = -EBUSY; + } else { udf_open_lvid(sb); + /* mark the fs r/w for quota activity */ + sb->s_flags &= ~MS_RDONLY; + vfs_dq_quota_on_remount(sb); + } + +out_unlock: unlock_kernel(); - return 0; + return error; } /* Check Volume Structure Descriptors (ECMA 167 2/9.1) */ |