aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/blk-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index dee56c282efb..4dbc93f43b38 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2163,9 +2163,12 @@ static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part)
2163{ 2163{
2164 const int op = bio_op(bio); 2164 const int op = bio_op(bio);
2165 2165
2166 if (part->policy && (op_is_write(op) && !op_is_flush(op))) { 2166 if (part->policy && op_is_write(op)) {
2167 char b[BDEVNAME_SIZE]; 2167 char b[BDEVNAME_SIZE];
2168 2168
2169 if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
2170 return false;
2171
2169 WARN_ONCE(1, 2172 WARN_ONCE(1,
2170 "generic_make_request: Trying to write " 2173 "generic_make_request: Trying to write "
2171 "to read-only block-device %s (partno %d)\n", 2174 "to read-only block-device %s (partno %d)\n",