The patch below does not apply to the 5.15-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 stable@vger.kernel.org.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 3899d94e3831ee07ea6821c032dc297aec80586a # <resolve conflicts, build, test, etc.> git commit -s git send-email --to 'stable@vger.kernel.org' --in-reply-to '2023050708-absently-subsidy-099a@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
3899d94e3831 ("drbd: correctly submit flush bio on barrier") 07888c665b40 ("block: pass a block_device and opf to bio_alloc") b77c88c2100c ("block: pass a block_device and opf to bio_alloc_kiocb") 609be1066731 ("block: pass a block_device and opf to bio_alloc_bioset") 0a3140ea0fae ("block: pass a block_device and opf to blk_next_bio") 3b005bf6acf0 ("block: move blk_next_bio to bio.c") 7d8d0c658d48 ("xen-blkback: bio_alloc can't fail if it is allow to sleep") d7b78de2b155 ("rnbd-srv: remove struct rnbd_dev_blk_io") 1fe0640ff94f ("rnbd-srv: simplify bio mapping in process_rdma") 4b1dc86d1857 ("drbd: bio_alloc can't fail if it is allow to sleep") 3f868c09ea8f ("dm-crypt: remove clone_init") 53db984e004c ("dm: bio_alloc can't fail if it is allowed to sleep") 39146b6f66ba ("ntfs3: remove ntfs_alloc_bio") 5d2ca2132f88 ("nfs/blocklayout: remove bl_alloc_init_bio") f0d911927b3c ("nilfs2: remove nilfs_alloc_seg_bio") d5f68a42da7a ("fs: remove mpage_alloc") ae4c81644e91 ("RDMA/rtrs-srv: Rename rtrs_srv_sess to rtrs_srv_path") d9372794717f ("RDMA/rtrs: Rename rtrs_sess to rtrs_path") 512b7931ad05 ("Merge branch 'akpm' (patches from Andrew)")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3899d94e3831ee07ea6821c032dc297aec80586a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= christoph.boehmwalder@linbit.com Date: Wed, 3 May 2023 14:19:37 +0200 Subject: [PATCH] drbd: correctly submit flush bio on barrier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
When we receive a flush command (or "barrier" in DRBD), we currently use a REQ_OP_FLUSH with the REQ_PREFLUSH flag set.
The correct way to submit a flush bio is by using a REQ_OP_WRITE without any data, and set the REQ_PREFLUSH flag.
Since commit b4a6bb3a67aa ("block: add a sanity check for non-write flush/fua bios"), this triggers a warning in the block layer, but this has been broken for quite some time before that.
So use the correct set of flags to actually make the flush happen.
Cc: Christoph Hellwig hch@infradead.org Cc: stable@vger.kernel.org Fixes: f9ff0da56437 ("drbd: allow parallel flushes for multi-volume resources") Reported-by: Thomas Voegtle tv@lio96.de Signed-off-by: Christoph Böhmwalder christoph.boehmwalder@linbit.com Reviewed-by: Christoph Hellwig hch@lst.de Link: https://lore.kernel.org/r/20230503121937.17232-1-christoph.boehmwalder@linbi... Signed-off-by: Jens Axboe axboe@kernel.dk
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index e54404c632e7..34b112752ab1 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1283,7 +1283,7 @@ static void one_flush_endio(struct bio *bio) static void submit_one_flush(struct drbd_device *device, struct issue_flush_context *ctx) { struct bio *bio = bio_alloc(device->ldev->backing_bdev, 0, - REQ_OP_FLUSH | REQ_PREFLUSH, GFP_NOIO); + REQ_OP_WRITE | REQ_PREFLUSH, GFP_NOIO); struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO);
if (!octx) {