FAILED: patch "[PATCH] md: Make flush bios explicitely sync" failed to apply to 4.11-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.11-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
5a8948f8a32ba56c17b3fb75d318ac98157f3ba5Mon Sep 17 00:00:00 2001
From: Jan Kara <[email protected]>
Date: Wed, 31 May 2017 09:44:33 +0200
Subject: [PATCH] md: 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.
drivers/md/md.c +1 -1
@@ -765,7 +765,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, test_bit(FailFast, &rdev->flags) && !test_bit(LastDev, &rdev->flags)) ff =MD_FAILFAST ; - bio->bi_opf =REQ_OP_WRITE |REQ_PREFLUSH |REQ_FUA | ff; + bio->bi_opf =REQ_OP_WRITE |REQ_SYNC |REQ_PREFLUSH |REQ_FUA | ff;atomic_inc (&mddev->pending_writes);submit_bio (bio);
drivers/md/raid5-cache.c +2 -2
@@ -1782,7 +1782,7 @@ static int r5l_log_write_empty_meta_block(struct r5l_log *log, sector_t pos, mb->checksum =cpu_to_le32 (crc32c_le (log->uuid_checksum, mb,PAGE_SIZE ));if (!sync_page_io (log->rdev, pos,PAGE_SIZE , page,REQ_OP_WRITE , -REQ_FUA , false)) { +REQ_SYNC |REQ_FUA , false)) {__free_page (page);return -EIO ; }
@@ -2388,7 +2388,7 @@ r5c_recovery_rewrite_data_only_stripes(struct r5l_log *log, mb->checksum =cpu_to_le32 (crc32c_le (log->uuid_checksum, mb,PAGE_SIZE ));sync_page_io (log->rdev, ctx->pos,PAGE_SIZE , page, -REQ_OP_WRITE ,REQ_FUA , false); +REQ_OP_WRITE ,REQ_SYNC |REQ_FUA , false); sh->log_start = ctx->pos;list_add_tail (&sh->r5c, &log->stripe_in_journal_list);atomic_inc (&log->stripe_in_journal_count);
drivers/md/raid5-ppl.c +2 -2
@@ -907,8 +907,8 @@ static int ppl_write_empty_header(struct ppl_log *log) pplhdr->checksum =cpu_to_le32 (~crc32c_le (~0 , pplhdr,PAGE_SIZE ));if (!sync_page_io (rdev, rdev->ppl.sector - rdev->data_offset, -PPL_HEADER_SIZE , page,REQ_OP_WRITE |REQ_FUA ,0 , - false)) { +PPL_HEADER_SIZE , page,REQ_OP_WRITE |REQ_SYNC | +REQ_FUA ,0 , false)) {md_error (rdev->mddev, rdev); ret = -EIO ; }