perf env: Avoid recursively taking env->bpf_progs.lock
[platform/kernel/linux-starfive.git] / block / blk-core.c
index 9866468..2eca76c 100644 (file)
@@ -208,6 +208,7 @@ const char *blk_status_to_str(blk_status_t status)
                return "<null>";
        return blk_errors[idx].name;
 }
+EXPORT_SYMBOL_GPL(blk_status_to_str);
 
 /**
  * blk_sync_queue - cancel any pending callbacks on a queue
@@ -500,9 +501,17 @@ static inline void bio_check_ro(struct bio *bio)
        if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) {
                if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
                        return;
+
+               if (bio->bi_bdev->bd_ro_warned)
+                       return;
+
+               bio->bi_bdev->bd_ro_warned = true;
+               /*
+                * Use ioctl to set underlying disk of raid/dm to read-only
+                * will trigger this.
+                */
                pr_warn("Trying to write to read-only block-device %pg\n",
                        bio->bi_bdev);
-               /* Older lvm-tools actually trigger this */
        }
 }