Commit 00473374 authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

ext4: mark superblock writes synchronous for nobarrier mounts

Commit b685d3d6 "block: treat REQ_FUA and REQ_PREFLUSH as
synchronous" removed REQ_SYNC flag from WRITE_FUA implementation.
generic_make_request_checks() however strips REQ_FUA flag from a bio
when the storage doesn't report volatile write cache and thus write
effectively becomes asynchronous which can lead to performance
regressions. This affects superblock writes for ext4. Fix the problem
by marking superblock writes always as synchronous.

Fixes: b685d3d6
CC: linux-ext4@vger.kernel.org
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent aa1dca3b
...@@ -4637,7 +4637,7 @@ static int ext4_commit_super(struct super_block *sb, int sync) ...@@ -4637,7 +4637,7 @@ static int ext4_commit_super(struct super_block *sb, int sync)
if (sync) { if (sync) {
unlock_buffer(sbh); unlock_buffer(sbh);
error = __sync_dirty_buffer(sbh, error = __sync_dirty_buffer(sbh,
test_opt(sb, BARRIER) ? REQ_FUA : REQ_SYNC); REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0));
if (error) if (error)
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment