diff options
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index b7d0554631e4..0e0d391626be 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -755,7 +755,7 @@ static int ext3_release_dquot(struct dquot *dquot); | |||
755 | static int ext3_mark_dquot_dirty(struct dquot *dquot); | 755 | static int ext3_mark_dquot_dirty(struct dquot *dquot); |
756 | static int ext3_write_info(struct super_block *sb, int type); | 756 | static int ext3_write_info(struct super_block *sb, int type); |
757 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 757 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
758 | char *path); | 758 | struct path *path); |
759 | static int ext3_quota_on_mount(struct super_block *sb, int type); | 759 | static int ext3_quota_on_mount(struct super_block *sb, int type); |
760 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, | 760 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, |
761 | size_t len, loff_t off); | 761 | size_t len, loff_t off); |
@@ -2885,27 +2885,20 @@ static int ext3_quota_on_mount(struct super_block *sb, int type) | |||
2885 | * Standard function to be called on quota_on | 2885 | * Standard function to be called on quota_on |
2886 | */ | 2886 | */ |
2887 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 2887 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
2888 | char *name) | 2888 | struct path *path) |
2889 | { | 2889 | { |
2890 | int err; | 2890 | int err; |
2891 | struct path path; | ||
2892 | 2891 | ||
2893 | if (!test_opt(sb, QUOTA)) | 2892 | if (!test_opt(sb, QUOTA)) |
2894 | return -EINVAL; | 2893 | return -EINVAL; |
2895 | 2894 | ||
2896 | err = kern_path(name, LOOKUP_FOLLOW, &path); | ||
2897 | if (err) | ||
2898 | return err; | ||
2899 | |||
2900 | /* Quotafile not on the same filesystem? */ | 2895 | /* Quotafile not on the same filesystem? */ |
2901 | if (path.mnt->mnt_sb != sb) { | 2896 | if (path->mnt->mnt_sb != sb) |
2902 | path_put(&path); | ||
2903 | return -EXDEV; | 2897 | return -EXDEV; |
2904 | } | ||
2905 | /* Journaling quota? */ | 2898 | /* Journaling quota? */ |
2906 | if (EXT3_SB(sb)->s_qf_names[type]) { | 2899 | if (EXT3_SB(sb)->s_qf_names[type]) { |
2907 | /* Quotafile not of fs root? */ | 2900 | /* Quotafile not of fs root? */ |
2908 | if (path.dentry->d_parent != sb->s_root) | 2901 | if (path->dentry->d_parent != sb->s_root) |
2909 | ext3_msg(sb, KERN_WARNING, | 2902 | ext3_msg(sb, KERN_WARNING, |
2910 | "warning: Quota file not on filesystem root. " | 2903 | "warning: Quota file not on filesystem root. " |
2911 | "Journaled quota will not work."); | 2904 | "Journaled quota will not work."); |
@@ -2915,7 +2908,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
2915 | * When we journal data on quota file, we have to flush journal to see | 2908 | * When we journal data on quota file, we have to flush journal to see |
2916 | * all updates to the file when we bypass pagecache... | 2909 | * all updates to the file when we bypass pagecache... |
2917 | */ | 2910 | */ |
2918 | if (ext3_should_journal_data(path.dentry->d_inode)) { | 2911 | if (ext3_should_journal_data(path->dentry->d_inode)) { |
2919 | /* | 2912 | /* |
2920 | * We don't need to lock updates but journal_flush() could | 2913 | * We don't need to lock updates but journal_flush() could |
2921 | * otherwise be livelocked... | 2914 | * otherwise be livelocked... |
@@ -2923,15 +2916,11 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
2923 | journal_lock_updates(EXT3_SB(sb)->s_journal); | 2916 | journal_lock_updates(EXT3_SB(sb)->s_journal); |
2924 | err = journal_flush(EXT3_SB(sb)->s_journal); | 2917 | err = journal_flush(EXT3_SB(sb)->s_journal); |
2925 | journal_unlock_updates(EXT3_SB(sb)->s_journal); | 2918 | journal_unlock_updates(EXT3_SB(sb)->s_journal); |
2926 | if (err) { | 2919 | if (err) |
2927 | path_put(&path); | ||
2928 | return err; | 2920 | return err; |
2929 | } | ||
2930 | } | 2921 | } |
2931 | 2922 | ||
2932 | err = dquot_quota_on_path(sb, type, format_id, &path); | 2923 | return dquot_quota_on(sb, type, format_id, path); |
2933 | path_put(&path); | ||
2934 | return err; | ||
2935 | } | 2924 | } |
2936 | 2925 | ||
2937 | /* Read data from quotafile - avoid pagecache and such because we cannot afford | 2926 | /* Read data from quotafile - avoid pagecache and such because we cannot afford |