btrfs: Make flush bios explicitely sync
authorJan Kara <jack@suse.cz>
Tue, 2 May 2017 15:03:50 +0000 (17:03 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 16 May 2017 13:42:01 +0000 (15:42 +0200)
commit8d91012528b3c95c159e6b6779e367421df9cbb5
tree7a10ebc80a4d62384bdf0e72e2d522f18aba1c63
parent4751832da990a927c37526ae67b9226ea01eb99e
btrfs: Make flush bios explicitely sync

Commit b685d3d65ac7 "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.

CC: David Sterba <dsterba@suse.com>
CC: linux-btrfs@vger.kernel.org
Fixes: b685d3d65ac791406e0dfd8779cc9b3707fea5a3
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c