diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/super.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d573f6c1a4de..c1036bc8a539 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -4138,7 +4138,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
4138 | ext4_lblk_t blk = off >> EXT4_BLOCK_SIZE_BITS(sb); | 4138 | ext4_lblk_t blk = off >> EXT4_BLOCK_SIZE_BITS(sb); |
4139 | int err = 0; | 4139 | int err = 0; |
4140 | int offset = off & (sb->s_blocksize - 1); | 4140 | int offset = off & (sb->s_blocksize - 1); |
4141 | int journal_quota = EXT4_SB(sb)->s_qf_names[type] != NULL; | ||
4142 | struct buffer_head *bh; | 4141 | struct buffer_head *bh; |
4143 | handle_t *handle = journal_current_handle(); | 4142 | handle_t *handle = journal_current_handle(); |
4144 | 4143 | ||
@@ -4163,24 +4162,16 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
4163 | bh = ext4_bread(handle, inode, blk, 1, &err); | 4162 | bh = ext4_bread(handle, inode, blk, 1, &err); |
4164 | if (!bh) | 4163 | if (!bh) |
4165 | goto out; | 4164 | goto out; |
4166 | if (journal_quota) { | 4165 | err = ext4_journal_get_write_access(handle, bh); |
4167 | err = ext4_journal_get_write_access(handle, bh); | 4166 | if (err) { |
4168 | if (err) { | 4167 | brelse(bh); |
4169 | brelse(bh); | 4168 | goto out; |
4170 | goto out; | ||
4171 | } | ||
4172 | } | 4169 | } |
4173 | lock_buffer(bh); | 4170 | lock_buffer(bh); |
4174 | memcpy(bh->b_data+offset, data, len); | 4171 | memcpy(bh->b_data+offset, data, len); |
4175 | flush_dcache_page(bh->b_page); | 4172 | flush_dcache_page(bh->b_page); |
4176 | unlock_buffer(bh); | 4173 | unlock_buffer(bh); |
4177 | if (journal_quota) | 4174 | err = ext4_handle_dirty_metadata(handle, NULL, bh); |
4178 | err = ext4_handle_dirty_metadata(handle, NULL, bh); | ||
4179 | else { | ||
4180 | /* Always do at least ordered writes for quotas */ | ||
4181 | err = ext4_jbd2_file_inode(handle, inode); | ||
4182 | mark_buffer_dirty(bh); | ||
4183 | } | ||
4184 | brelse(bh); | 4175 | brelse(bh); |
4185 | out: | 4176 | out: |
4186 | if (err) { | 4177 | if (err) { |