diff mbox

[4/7] gfs2: Make flush bios explicitely sync

Message ID 20170502150351.29452-5-jack@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kara May 2, 2017, 3:03 p.m. UTC
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.

Fixes: b685d3d65ac791406e0dfd8779cc9b3707fea5a3
CC: Steven Whitehouse <swhiteho@redhat.com>
CC: cluster-devel@redhat.com
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/gfs2/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bob Peterson May 2, 2017, 3:44 p.m. UTC | #1
----- Original Message -----
| 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.

Hi,

Looks good.
Acked-by: Bob Peterson <rpeterso@redhat.com>

Regards,

Bob Peterson
Red Hat File Systems
diff mbox

Patch

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index f865b96374df..d2955daf17a4 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -659,7 +659,7 @@  static void log_write_header(struct gfs2_sbd *sdp, u32 flags)
 	struct gfs2_log_header *lh;
 	unsigned int tail;
 	u32 hash;
-	int op_flags = REQ_PREFLUSH | REQ_FUA | REQ_META;
+	int op_flags = REQ_PREFLUSH | REQ_FUA | REQ_META | REQ_SYNC;
 	struct page *page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
 	enum gfs2_freeze_state state = atomic_read(&sdp->sd_freeze_state);
 	lh = page_address(page);