diff options
| author | Jens Axboe <axboe@kernel.dk> | 2018-08-14 12:52:40 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-08-14 12:52:40 -0400 |
| commit | b089cfd95d32638335c551651a8e00fd2c4edb0b (patch) | |
| tree | 5e48ee9470ecab0bd4525fcb93ab97a9f6b583d0 /block/blk-core.c | |
| parent | eb2b3d034511f7f5f5fa781b9354ea4d5dbd4fc5 (diff) | |
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: Stefan Agner <stefan@agner.ch>
Fixes: 721c7fc701c7 ("block: fail op_is_write() requests to read-only partitions")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
| -rw-r--r-- | block/blk-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 49af34bf2119..7aeef19704f2 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -2162,7 +2162,9 @@ static inline bool should_fail_request(struct hd_struct *part, | |||
| 2162 | 2162 | ||
| 2163 | static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part) | 2163 | static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part) |
| 2164 | { | 2164 | { |
| 2165 | if (part->policy && op_is_write(bio_op(bio))) { | 2165 | const int op = bio_op(bio); |
| 2166 | |||
| 2167 | if (part->policy && (op_is_write(op) && !op_is_flush(op))) { | ||
| 2166 | char b[BDEVNAME_SIZE]; | 2168 | char b[BDEVNAME_SIZE]; |
| 2167 | 2169 | ||
| 2168 | printk(KERN_ERR | 2170 | printk(KERN_ERR |
