Merge tag 'for-4.19/post-20180822' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / block / blk-core.c
index 5832c4003cfb7d09974acd02c1e7aaf3ac0c52a8..dee56c282efb092196cd9be8400b6bc68c7f7f27 100644 (file)
@@ -2166,11 +2166,12 @@ static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part)
        if (part->policy && (op_is_write(op) && !op_is_flush(op))) {
                char b[BDEVNAME_SIZE];
 
-               printk(KERN_ERR
+               WARN_ONCE(1,
                       "generic_make_request: Trying to write "
                        "to read-only block-device %s (partno %d)\n",
                        bio_devname(bio, b), part->partno);
-               return true;
+               /* Older lvm-tools actually trigger this */
+               return false;
        }
 
        return false;