Skip to content

Commit

Permalink
quota: ext4: make ext4 handle quotaon on remount
Browse files Browse the repository at this point in the history
Update ext4 to handle quotaon on remount RW.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Apr 28, 2008
1 parent 2fd83a4 commit 6f28e08
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ static int ext4_acquire_dquot(struct dquot *dquot);
static int ext4_release_dquot(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_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 ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off);
Expand Down Expand Up @@ -1632,7 +1633,7 @@ static void ext4_orphan_cleanup (struct super_block * sb,
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(sb)->files[i])
vfs_quota_off(sb, i);
vfs_quota_off(sb, i, 0);
}
#endif
sb->s_flags = s_flags; /* Restore MS_RDONLY status */
Expand Down Expand Up @@ -3143,17 +3144,17 @@ static int ext4_quota_on_mount(struct super_block *sb, int type)
* Standard function to be called on quota_on
*/
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
char *path)
char *path, int remount)
{
int err;
struct nameidata nd;

if (!test_opt(sb, QUOTA))
return -EINVAL;
/* Not journalling quota? */
if (!EXT4_SB(sb)->s_qf_names[USRQUOTA] &&
!EXT4_SB(sb)->s_qf_names[GRPQUOTA])
return vfs_quota_on(sb, type, format_id, path);
if ((!EXT4_SB(sb)->s_qf_names[USRQUOTA] &&
!EXT4_SB(sb)->s_qf_names[GRPQUOTA]) || remount)
return vfs_quota_on(sb, type, format_id, path, remount);
err = path_lookup(path, LOOKUP_FOLLOW, &nd);
if (err)
return err;
Expand All @@ -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. "
"Journalled quota will not work.\n");
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
Expand Down

0 comments on commit 6f28e08

Please sign in to comment.