diff options
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r-- | fs/reiserfs/super.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 1d40f2bd1970..0cbf4cd11147 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -2026,6 +2026,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2026 | int err; | 2026 | int err; |
2027 | struct nameidata nd; | 2027 | struct nameidata nd; |
2028 | struct inode *inode; | 2028 | struct inode *inode; |
2029 | struct reiserfs_transaction_handle th; | ||
2029 | 2030 | ||
2030 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) | 2031 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) |
2031 | return -EINVAL; | 2032 | return -EINVAL; |
@@ -2053,17 +2054,28 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
2053 | } | 2054 | } |
2054 | mark_inode_dirty(inode); | 2055 | mark_inode_dirty(inode); |
2055 | } | 2056 | } |
2056 | /* Not journalling quota? No more tests needed... */ | 2057 | /* Journaling quota? */ |
2057 | if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] && | 2058 | if (REISERFS_SB(sb)->s_qf_names[type]) { |
2058 | !REISERFS_SB(sb)->s_qf_names[GRPQUOTA]) { | 2059 | /* Quotafile not of fs root? */ |
2059 | path_put(&nd.path); | 2060 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) |
2060 | return vfs_quota_on(sb, type, format_id, path, 0); | 2061 | reiserfs_warning(sb, |
2061 | } | ||
2062 | /* Quotafile not of fs root? */ | ||
2063 | if (nd.path.dentry->d_parent->d_inode != sb->s_root->d_inode) | ||
2064 | reiserfs_warning(sb, | ||
2065 | "reiserfs: Quota file not on filesystem root. " | 2062 | "reiserfs: Quota file not on filesystem root. " |
2066 | "Journalled quota will not work."); | 2063 | "Journalled quota will not work."); |
2064 | } | ||
2065 | |||
2066 | /* | ||
2067 | * When we journal data on quota file, we have to flush journal to see | ||
2068 | * all updates to the file when we bypass pagecache... | ||
2069 | */ | ||
2070 | if (reiserfs_file_data_log(inode)) { | ||
2071 | /* Just start temporary transaction and finish it */ | ||
2072 | err = journal_begin(&th, sb, 1); | ||
2073 | if (err) | ||
2074 | return err; | ||
2075 | err = journal_end_sync(&th, sb, 1); | ||
2076 | if (err) | ||
2077 | return err; | ||
2078 | } | ||
2067 | path_put(&nd.path); | 2079 | path_put(&nd.path); |
2068 | return vfs_quota_on(sb, type, format_id, path, 0); | 2080 | return vfs_quota_on(sb, type, format_id, path, 0); |
2069 | } | 2081 | } |