aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-04-28 05:14:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:33 -0400
commit2fd83a4f3cd5a725168e3a269746dfce2adfa56a (patch)
tree8dd1ea97556d28ff90bacc559bbe3d042ad1b185 /fs
parent0ff5af8340aa6be44220d7237ef4a654314cf795 (diff)
quota: ext3: make ext3 handle quotaon on remount
Update ext3 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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext3/super.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index ad5360664082..883ff965d984 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -685,7 +685,8 @@ static int ext3_acquire_dquot(struct dquot *dquot);
685static int ext3_release_dquot(struct dquot *dquot); 685static int ext3_release_dquot(struct dquot *dquot);
686static int ext3_mark_dquot_dirty(struct dquot *dquot); 686static int ext3_mark_dquot_dirty(struct dquot *dquot);
687static int ext3_write_info(struct super_block *sb, int type); 687static int ext3_write_info(struct super_block *sb, int type);
688static int ext3_quota_on(struct super_block *sb, int type, int format_id, char *path); 688static int ext3_quota_on(struct super_block *sb, int type, int format_id,
689 char *path, int remount);
689static int ext3_quota_on_mount(struct super_block *sb, int type); 690static int ext3_quota_on_mount(struct super_block *sb, int type);
690static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, 691static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data,
691 size_t len, loff_t off); 692 size_t len, loff_t off);
@@ -1415,7 +1416,7 @@ static void ext3_orphan_cleanup (struct super_block * sb,
1415 /* Turn quotas off */ 1416 /* Turn quotas off */
1416 for (i = 0; i < MAXQUOTAS; i++) { 1417 for (i = 0; i < MAXQUOTAS; i++) {
1417 if (sb_dqopt(sb)->files[i]) 1418 if (sb_dqopt(sb)->files[i])
1418 vfs_quota_off(sb, i); 1419 vfs_quota_off(sb, i, 0);
1419 } 1420 }
1420#endif 1421#endif
1421 sb->s_flags = s_flags; /* Restore MS_RDONLY status */ 1422 sb->s_flags = s_flags; /* Restore MS_RDONLY status */
@@ -2743,17 +2744,17 @@ static int ext3_quota_on_mount(struct super_block *sb, int type)
2743 * Standard function to be called on quota_on 2744 * Standard function to be called on quota_on
2744 */ 2745 */
2745static int ext3_quota_on(struct super_block *sb, int type, int format_id, 2746static int ext3_quota_on(struct super_block *sb, int type, int format_id,
2746 char *path) 2747 char *path, int remount)
2747{ 2748{
2748 int err; 2749 int err;
2749 struct nameidata nd; 2750 struct nameidata nd;
2750 2751
2751 if (!test_opt(sb, QUOTA)) 2752 if (!test_opt(sb, QUOTA))
2752 return -EINVAL; 2753 return -EINVAL;
2753 /* Not journalling quota? */ 2754 /* Not journalling quota or remount? */
2754 if (!EXT3_SB(sb)->s_qf_names[USRQUOTA] && 2755 if ((!EXT3_SB(sb)->s_qf_names[USRQUOTA] &&
2755 !EXT3_SB(sb)->s_qf_names[GRPQUOTA]) 2756 !EXT3_SB(sb)->s_qf_names[GRPQUOTA]) || remount)
2756 return vfs_quota_on(sb, type, format_id, path); 2757 return vfs_quota_on(sb, type, format_id, path, remount);
2757 err = path_lookup(path, LOOKUP_FOLLOW, &nd); 2758 err = path_lookup(path, LOOKUP_FOLLOW, &nd);
2758 if (err) 2759 if (err)
2759 return err; 2760 return err;
@@ -2762,13 +2763,13 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
2762 path_put(&nd.path); 2763 path_put(&nd.path);
2763 return -EXDEV; 2764 return -EXDEV;
2764 } 2765 }
2765 /* Quotafile not of fs root? */ 2766 /* Quotafile not in fs root? */
2766 if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) 2767 if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode)
2767 printk(KERN_WARNING 2768 printk(KERN_WARNING
2768 "EXT3-fs: Quota file not on filesystem root. " 2769 "EXT3-fs: Quota file not on filesystem root. "
2769 "Journalled quota will not work.\n"); 2770 "Journalled quota will not work.\n");
2770 path_put(&nd.path); 2771 path_put(&nd.path);
2771 return vfs_quota_on(sb, type, format_id, path); 2772 return vfs_quota_on(sb, type, format_id, path, remount);
2772} 2773}
2773 2774
2774/* Read data from quotafile - avoid pagecache and such because we cannot afford 2775/* Read data from quotafile - avoid pagecache and such because we cannot afford