Skip to content

Commit

Permalink
reiserfs: Make flush bios explicitely sync
Browse files Browse the repository at this point in the history
Commit b685d3d "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: b685d3d
CC: reiserfs-devel@vger.kernel.org
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Jan Kara committed May 24, 2017
1 parent 0f0b9b6 commit d8747d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/reiserfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ static int flush_commit_list(struct super_block *s,
depth = reiserfs_write_unlock_nested(s);
if (reiserfs_barrier_flush(s))
__sync_dirty_buffer(jl->j_commit_bh,
REQ_PREFLUSH | REQ_FUA);
REQ_SYNC | REQ_PREFLUSH | REQ_FUA);
else
sync_dirty_buffer(jl->j_commit_bh);
reiserfs_write_lock_nested(s, depth);
Expand Down Expand Up @@ -1271,7 +1271,7 @@ static int _update_journal_header_block(struct super_block *sb,

if (reiserfs_barrier_flush(sb))
__sync_dirty_buffer(journal->j_header_bh,
REQ_PREFLUSH | REQ_FUA);
REQ_SYNC | REQ_PREFLUSH | REQ_FUA);
else
sync_dirty_buffer(journal->j_header_bh);

Expand Down

0 comments on commit d8747d6

Please sign in to comment.