linux-stable/drivers/block
Christoph Böhmwalder 3c9b08a169 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-17 11:50:31 +02:00
..
aoe for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00
drbd drbd: correctly submit flush bio on barrier 2023-05-17 11:50:31 +02:00
mtip32xx block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-23 12:03:15 +01:00
null_blk block: null_blk: Fix handling of fake timeout request 2023-03-22 13:31:27 +01:00
paride SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
rnbd block/rnbd-srv: Set keep_id to true after mutex_trylock 2022-08-17 14:24:00 +02:00
rsxx block: handle bio_split_to_limits() NULL return 2023-01-18 11:48:58 +01:00
xen-blkback xen-blkback: Advertise feature-persistent as user requested 2022-09-08 12:28:05 +02:00
zram zram: do not lookup algorithm in backends table 2022-08-25 11:40:34 +02:00
amiflop.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
ataflop.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
brd.c brd: mark as nowait compatible 2023-03-17 08:48:51 +01:00
cryptoloop.c cryptoloop: add a deprecation warning 2021-08-27 10:44:54 -06:00
floppy.c floppy: Fix memory leak in do_floppy_init() 2022-12-31 13:14:47 +01:00
Kconfig virtio-blk: avoid preallocating big SGL for data 2022-07-12 16:34:56 +02:00
loop.c loop: LOOP_CONFIGURE: send uevents for partitions 2023-04-05 11:24:56 +02:00
loop.h loop: reduce the loop_ctl_mutex scope 2021-09-03 22:14:40 -06:00
Makefile drivers/block: remove the umem driver 2021-03-24 06:57:40 -06:00
n64cart.c n64cart: convert bi_disk to bi_bdev->bd_disk fix build 2022-04-08 14:24:16 +02:00
nbd.c nbd: use the correct block_device in nbd_bdev_reset 2023-03-17 08:48:58 +01:00
pktcdvd.c block: handle bio_split_to_limits() NULL return 2023-01-18 11:48:58 +01:00
ps3disk.c ps3disk: use memcpy_{from,to}_bvec 2021-08-02 13:37:27 -06:00
ps3vram.c block: handle bio_split_to_limits() NULL return 2023-01-18 11:48:58 +01:00
rbd.c rbd: avoid use-after-free in do_rbd_add() when rbd_dev_create() fails 2023-03-10 09:40:08 +01:00
rbd_types.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:31:27 +01:00
swim.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
swim3.c swim3: use blk_mq_alloc_disk 2021-06-11 11:53:02 -06:00
swim_asm.S
sx8.c sx8: use the internal state machine to check if del_gendisk needs to be called 2021-08-12 10:29:36 -06:00
virtio_blk.c virtio-blk: modify the value type of num in virtio_queue_rq() 2022-07-12 16:35:11 +02:00
xen-blkfront.c xen-blkfront: Cache feature_persistent value before advertisement 2022-09-08 12:28:05 +02:00
z2ram.c for-5.14/drivers-2021-06-29 2021-06-30 12:21:16 -07:00