linux-stable/drivers/block
Christoph Böhmwalder ce79502405 drbd: correctly submit flush bio on barrier
commit 3899d94e38 upstream.

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 b4a6bb3a67 ("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: f9ff0da564 ("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@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:11:33 +09:00
..
aoe driver core: make struct class.devnode() take a const * 2022-11-24 17:12:27 +01:00
drbd drbd: correctly submit flush bio on barrier 2023-05-11 23:11:33 +09:00
mtip32xx block: move from strlcpy with unused retval to strscpy 2022-09-21 19:45:04 -06:00
null_blk block: null_blk: Fix handling of fake timeout request 2023-03-22 13:37:50 +01:00
paride block: Change the type of req_op() and bio_op() into enum req_op 2022-07-14 12:14:30 -06:00
rnbd block/rnbd-clt: fix wrong max ID in ida_alloc_max 2023-01-17 08:33:36 -07:00
xen-blkback xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00
zram block: count 'ios' and 'sectors' when io is done for bio-based device 2023-03-22 13:37:50 +01:00
Kconfig Revert "pktcdvd: remove driver." 2023-01-04 14:44:13 -07:00
Makefile Revert "pktcdvd: remove driver." 2023-01-04 14:44:13 -07:00
amiflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ataflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
brd.c brd: use radix_tree_maybe_preload instead of radix_tree_preload 2023-03-10 09:29:57 +01:00
floppy.c floppy: Fix memory leak in do_floppy_init() 2022-12-04 18:03:41 +04:00
loop.c loop: LOOP_CONFIGURE: send uevents for partitions 2023-04-06 12:12:37 +02:00
n64cart.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
nbd.c Treewide: Stop corrupting socket's task_frag 2022-12-19 17:28:49 -08:00
pktcdvd.c pktcdvd: check for NULL returna fter calling bio_split_to_limits() 2023-01-16 08:51:05 -07:00
ps3disk.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ps3vram.c block: handle bio_split_to_limits() NULL return 2023-01-04 09:05:23 -07:00
rbd.c rbd: avoid use-after-free in do_rbd_add() when rbd_dev_create() fails 2023-03-10 09:29:47 +01:00
rbd_types.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:37:50 +01:00
swim.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim3.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim_asm.S
ublk_drv.c block: ublk_drv: mark device as LIVE before adding disk 2023-04-20 12:36:56 +02:00
virtio_blk.c virtio_blk: Fix signedness bug in virtblk_prep_rq() 2022-12-28 05:28:11 -05:00
xen-blkfront.c xen: branch for v6.2-rc4 2023-01-12 17:02:20 -06:00
z2ram.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00