Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b089cfd9 authored by Jens Axboe's avatar Jens Axboe
Browse files

block: don't warn for flush on read-only device



Don't warn for a flush issued to a read-only device. It's not strictly
a writable command, as it doesn't change any on-media data by itself.

Reported-by: default avatarStefan Agner <stefan@agner.ch>
Fixes: 721c7fc7 ("block: fail op_is_write() requests to read-only partitions")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent eb2b3d03
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2162,7 +2162,9 @@ static inline bool should_fail_request(struct hd_struct *part,

static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part)
{
	if (part->policy && op_is_write(bio_op(bio))) {
	const int op = bio_op(bio);

	if (part->policy && (op_is_write(op) && !op_is_flush(op))) {
		char b[BDEVNAME_SIZE];

		printk(KERN_ERR