aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-07-27 11:56:07 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-07-27 11:56:07 -0400
commit62d2b5f2dcd3707b070efb16bbfdf6947c38c194 (patch)
tree4e721db0ab4893f6d619d20d10c1a635da079700 /fs/ext4
parentdcc7dae3cb21184a317f10a12250bd8d6f458077 (diff)
ext4: Always journal quota file modifications
When journaled quota options are not specified, we do writes to quota files just in data=ordered mode. This actually causes warnings from JBD2 about dirty journaled buffer because ext4_getblk unconditionally treats a block allocated by it as metadata. Since quota actually is filesystem metadata, the easiest way to get rid of the warning is to always treat quota writes as metadata... Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c19
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);
4185out: 4176out:
4186 if (err) { 4177 if (err) {