Commit 6f28e087 authored by Jan Kara's avatar Jan Kara Committed by Linus Torvalds

quota: ext4: make ext4 handle quotaon on remount

Update ext4 to handle quotaon on remount RW.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2fd83a4f
...@@ -813,7 +813,8 @@ static int ext4_acquire_dquot(struct dquot *dquot); ...@@ -813,7 +813,8 @@ static int ext4_acquire_dquot(struct dquot *dquot);
static int ext4_release_dquot(struct dquot *dquot); static int ext4_release_dquot(struct dquot *dquot);
static int ext4_mark_dquot_dirty(struct dquot *dquot); static int ext4_mark_dquot_dirty(struct dquot *dquot);
static int ext4_write_info(struct super_block *sb, int type); static int ext4_write_info(struct super_block *sb, int type);
static int ext4_quota_on(struct super_block *sb, int type, int format_id, char *path); static int ext4_quota_on(struct super_block *sb, int type, int format_id,
char *path, int remount);
static int ext4_quota_on_mount(struct super_block *sb, int type); static int ext4_quota_on_mount(struct super_block *sb, int type);
static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off); size_t len, loff_t off);
...@@ -1632,7 +1633,7 @@ static void ext4_orphan_cleanup (struct super_block * sb, ...@@ -1632,7 +1633,7 @@ static void ext4_orphan_cleanup (struct super_block * sb,
/* Turn quotas off */ /* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) { for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(sb)->files[i]) if (sb_dqopt(sb)->files[i])
vfs_quota_off(sb, i); vfs_quota_off(sb, i, 0);
} }
#endif #endif
sb->s_flags = s_flags; /* Restore MS_RDONLY status */ sb->s_flags = s_flags; /* Restore MS_RDONLY status */
...@@ -3143,7 +3144,7 @@ static int ext4_quota_on_mount(struct super_block *sb, int type) ...@@ -3143,7 +3144,7 @@ static int ext4_quota_on_mount(struct super_block *sb, int type)
* Standard function to be called on quota_on * Standard function to be called on quota_on
*/ */
static int ext4_quota_on(struct super_block *sb, int type, int format_id, static int ext4_quota_on(struct super_block *sb, int type, int format_id,
char *path) char *path, int remount)
{ {
int err; int err;
struct nameidata nd; struct nameidata nd;
...@@ -3151,9 +3152,9 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, ...@@ -3151,9 +3152,9 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
if (!test_opt(sb, QUOTA)) if (!test_opt(sb, QUOTA))
return -EINVAL; return -EINVAL;
/* Not journalling quota? */ /* Not journalling quota? */
if (!EXT4_SB(sb)->s_qf_names[USRQUOTA] && if ((!EXT4_SB(sb)->s_qf_names[USRQUOTA] &&
!EXT4_SB(sb)->s_qf_names[GRPQUOTA]) !EXT4_SB(sb)->s_qf_names[GRPQUOTA]) || remount)
return vfs_quota_on(sb, type, format_id, path); return vfs_quota_on(sb, type, format_id, path, remount);
err = path_lookup(path, LOOKUP_FOLLOW, &nd); err = path_lookup(path, LOOKUP_FOLLOW, &nd);
if (err) if (err)
return err; return err;
...@@ -3168,7 +3169,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, ...@@ -3168,7 +3169,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
"EXT4-fs: Quota file not on filesystem root. " "EXT4-fs: Quota file not on filesystem root. "
"Journalled quota will not work.\n"); "Journalled quota will not work.\n");
path_put(&nd.path); path_put(&nd.path);
return vfs_quota_on(sb, type, format_id, path); return vfs_quota_on(sb, type, format_id, path, remount);
} }
/* Read data from quotafile - avoid pagecache and such because we cannot afford /* Read data from quotafile - avoid pagecache and such because we cannot afford
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment