Commit f0aa7a04 authored by Jan Kara's avatar Jan Kara Committed by Greg Kroah-Hartman

reiserfs: Make flush bios explicitely sync

commit d8747d64 upstream.

Commit b685d3d6 "block: treat REQ_FUA and REQ_PREFLUSH as
synchronous" removed REQ_SYNC flag from WRITE_{FUA|PREFLUSH|...}
definitions.  generic_make_request_checks() however strips REQ_FUA and
REQ_PREFLUSH flags from a bio when the storage doesn't report volatile
write cache and thus write effectively becomes asynchronous which can
lead to performance regressions

Fix the problem by making sure all bios which are synchronous are
properly marked with REQ_SYNC.

Fixes: b685d3d6
CC: reiserfs-devel@vger.kernel.org
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f2fee0c4
...@@ -1112,7 +1112,7 @@ static int flush_commit_list(struct super_block *s, ...@@ -1112,7 +1112,7 @@ static int flush_commit_list(struct super_block *s,
depth = reiserfs_write_unlock_nested(s); depth = reiserfs_write_unlock_nested(s);
if (reiserfs_barrier_flush(s)) if (reiserfs_barrier_flush(s))
__sync_dirty_buffer(jl->j_commit_bh, __sync_dirty_buffer(jl->j_commit_bh,
REQ_PREFLUSH | REQ_FUA); REQ_SYNC | REQ_PREFLUSH | REQ_FUA);
else else
sync_dirty_buffer(jl->j_commit_bh); sync_dirty_buffer(jl->j_commit_bh);
reiserfs_write_lock_nested(s, depth); reiserfs_write_lock_nested(s, depth);
...@@ -1271,7 +1271,7 @@ static int _update_journal_header_block(struct super_block *sb, ...@@ -1271,7 +1271,7 @@ static int _update_journal_header_block(struct super_block *sb,
if (reiserfs_barrier_flush(sb)) if (reiserfs_barrier_flush(sb))
__sync_dirty_buffer(journal->j_header_bh, __sync_dirty_buffer(journal->j_header_bh,
REQ_PREFLUSH | REQ_FUA); REQ_SYNC | REQ_PREFLUSH | REQ_FUA);
else else
sync_dirty_buffer(journal->j_header_bh); sync_dirty_buffer(journal->j_header_bh);
......
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