diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9b2b2bc4ec17..ae35f176b697 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3328,30 +3328,30 @@ static int ext4_quota_on_mount(struct super_block *sb, int type) | |||
3328 | * Standard function to be called on quota_on | 3328 | * Standard function to be called on quota_on |
3329 | */ | 3329 | */ |
3330 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 3330 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
3331 | char *path, int remount) | 3331 | char *name, int remount) |
3332 | { | 3332 | { |
3333 | int err; | 3333 | int err; |
3334 | struct nameidata nd; | 3334 | struct path path; |
3335 | 3335 | ||
3336 | if (!test_opt(sb, QUOTA)) | 3336 | if (!test_opt(sb, QUOTA)) |
3337 | return -EINVAL; | 3337 | return -EINVAL; |
3338 | /* When remounting, no checks are needed and in fact, path is NULL */ | 3338 | /* When remounting, no checks are needed and in fact, name is NULL */ |
3339 | if (remount) | 3339 | if (remount) |
3340 | return vfs_quota_on(sb, type, format_id, path, remount); | 3340 | return vfs_quota_on(sb, type, format_id, name, remount); |
3341 | 3341 | ||
3342 | err = path_lookup(path, LOOKUP_FOLLOW, &nd); | 3342 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
3343 | if (err) | 3343 | if (err) |
3344 | return err; | 3344 | return err; |
3345 | 3345 | ||
3346 | /* Quotafile not on the same filesystem? */ | 3346 | /* Quotafile not on the same filesystem? */ |
3347 | if (nd.path.mnt->mnt_sb != sb) { | 3347 | if (path.mnt->mnt_sb != sb) { |
3348 | path_put(&nd.path); | 3348 | path_put(&path); |
3349 | return -EXDEV; | 3349 | return -EXDEV; |
3350 | } | 3350 | } |
3351 | /* Journaling quota? */ | 3351 | /* Journaling quota? */ |
3352 | if (EXT4_SB(sb)->s_qf_names[type]) { | 3352 | if (EXT4_SB(sb)->s_qf_names[type]) { |
3353 | /* Quotafile not in fs root? */ | 3353 | /* Quotafile not in fs root? */ |
3354 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | 3354 | if (path.dentry->d_parent != sb->s_root) |
3355 | printk(KERN_WARNING | 3355 | printk(KERN_WARNING |
3356 | "EXT4-fs: Quota file not on filesystem root. " | 3356 | "EXT4-fs: Quota file not on filesystem root. " |
3357 | "Journaled quota will not work.\n"); | 3357 | "Journaled quota will not work.\n"); |
@@ -3361,7 +3361,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
3361 | * When we journal data on quota file, we have to flush journal to see | 3361 | * When we journal data on quota file, we have to flush journal to see |
3362 | * all updates to the file when we bypass pagecache... | 3362 | * all updates to the file when we bypass pagecache... |
3363 | */ | 3363 | */ |
3364 | if (ext4_should_journal_data(nd.path.dentry->d_inode)) { | 3364 | if (ext4_should_journal_data(path.dentry->d_inode)) { |
3365 | /* | 3365 | /* |
3366 | * We don't need to lock updates but journal_flush() could | 3366 | * We don't need to lock updates but journal_flush() could |
3367 | * otherwise be livelocked... | 3367 | * otherwise be livelocked... |
@@ -3370,13 +3370,13 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
3370 | err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); | 3370 | err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); |
3371 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); | 3371 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); |
3372 | if (err) { | 3372 | if (err) { |
3373 | path_put(&nd.path); | 3373 | path_put(&path); |
3374 | return err; | 3374 | return err; |
3375 | } | 3375 | } |
3376 | } | 3376 | } |
3377 | 3377 | ||
3378 | err = vfs_quota_on_path(sb, type, format_id, &nd.path); | 3378 | err = vfs_quota_on_path(sb, type, format_id, &path); |
3379 | path_put(&nd.path); | 3379 | path_put(&path); |
3380 | return err; | 3380 | return err; |
3381 | } | 3381 | } |
3382 | 3382 | ||