mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-15 05:17:31 +07:00
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>
This commit is contained in:
parent
dcc7dae3cb
commit
62d2b5f2dc
@ -4138,7 +4138,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
|
|||||||
ext4_lblk_t blk = off >> EXT4_BLOCK_SIZE_BITS(sb);
|
ext4_lblk_t blk = off >> EXT4_BLOCK_SIZE_BITS(sb);
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int offset = off & (sb->s_blocksize - 1);
|
int offset = off & (sb->s_blocksize - 1);
|
||||||
int journal_quota = EXT4_SB(sb)->s_qf_names[type] != NULL;
|
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
handle_t *handle = journal_current_handle();
|
handle_t *handle = journal_current_handle();
|
||||||
|
|
||||||
@ -4163,24 +4162,16 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
|
|||||||
bh = ext4_bread(handle, inode, blk, 1, &err);
|
bh = ext4_bread(handle, inode, blk, 1, &err);
|
||||||
if (!bh)
|
if (!bh)
|
||||||
goto out;
|
goto out;
|
||||||
if (journal_quota) {
|
err = ext4_journal_get_write_access(handle, bh);
|
||||||
err = ext4_journal_get_write_access(handle, bh);
|
if (err) {
|
||||||
if (err) {
|
brelse(bh);
|
||||||
brelse(bh);
|
goto out;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
lock_buffer(bh);
|
lock_buffer(bh);
|
||||||
memcpy(bh->b_data+offset, data, len);
|
memcpy(bh->b_data+offset, data, len);
|
||||||
flush_dcache_page(bh->b_page);
|
flush_dcache_page(bh->b_page);
|
||||||
unlock_buffer(bh);
|
unlock_buffer(bh);
|
||||||
if (journal_quota)
|
err = ext4_handle_dirty_metadata(handle, NULL, bh);
|
||||||
err = ext4_handle_dirty_metadata(handle, NULL, bh);
|
|
||||||
else {
|
|
||||||
/* Always do at least ordered writes for quotas */
|
|
||||||
err = ext4_jbd2_file_inode(handle, inode);
|
|
||||||
mark_buffer_dirty(bh);
|
|
||||||
}
|
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
out:
|
out:
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user