The only writes without no sectors are pure flush requests, so drop the extra op_is_flush check. Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- block/blk-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 2ae22bebeb3ee1..4ba243968e41eb 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -494,9 +494,8 @@ late_initcall(fail_make_request_debugfs); static inline void bio_check_ro(struct bio *bio) { - if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) { - if (op_is_flush(bio->bi_opf) && !bio_sectors(bio)) - return; + if (op_is_write(bio_op(bio)) && bio_sectors(bio) && + bdev_read_only(bio->bi_bdev)) { pr_warn("Trying to write to read-only block-device %pg\n", bio->bi_bdev); /* Older lvm-tools actually trigger this */ -- 2.39.2