diff options
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r-- | fs/reiserfs/super.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index a4c9770a6012..ed424d708e69 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -2025,6 +2025,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2025 | { | 2025 | { |
2026 | int err; | 2026 | int err; |
2027 | struct nameidata nd; | 2027 | struct nameidata nd; |
2028 | struct inode *inode; | ||
2028 | 2029 | ||
2029 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) | 2030 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) |
2030 | return -EINVAL; | 2031 | return -EINVAL; |
@@ -2039,12 +2040,18 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2039 | path_put(&nd.path); | 2040 | path_put(&nd.path); |
2040 | return -EXDEV; | 2041 | return -EXDEV; |
2041 | } | 2042 | } |
2043 | inode = nd.path.dentry->d_inode; | ||
2042 | /* We must not pack tails for quota files on reiserfs for quota IO to work */ | 2044 | /* We must not pack tails for quota files on reiserfs for quota IO to work */ |
2043 | if (!(REISERFS_I(nd.path.dentry->d_inode)->i_flags & i_nopack_mask)) { | 2045 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { |
2044 | reiserfs_warning(sb, | 2046 | err = reiserfs_unpack(inode, NULL); |
2045 | "reiserfs: Quota file must have tail packing disabled."); | 2047 | if (err) { |
2046 | path_put(&nd.path); | 2048 | reiserfs_warning(sb, |
2047 | return -EINVAL; | 2049 | "reiserfs: Unpacking tail of quota file failed" |
2050 | " (%d). Cannot turn on quotas.", err); | ||
2051 | path_put(&nd.path); | ||
2052 | return -EINVAL; | ||
2053 | } | ||
2054 | mark_inode_dirty(inode); | ||
2048 | } | 2055 | } |
2049 | /* Not journalling quota? No more tests needed... */ | 2056 | /* Not journalling quota? No more tests needed... */ |
2050 | if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] && | 2057 | if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] && |