mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-11 15:46:40 +02:00
block: don't warn for flush on read-only device
[ Upstream commitb089cfd95d] 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:721c7fc701("block: fail op_is_write() requests to read-only partitions") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
534dde34bb
commit
b02fd8a8dc
+3
-1
@@ -2159,7 +2159,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];
|
||||
|
||||
WARN_ONCE(1,
|
||||
|
||||
Reference in New Issue
Block a user