OSDN Git Service

Merge tag 'for-5.18/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git...
[uclinux-h8/linux.git] / block / genhd.c
index 37eb41e..c9a4fc9 100644 (file)
@@ -412,6 +412,10 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
        struct device *ddev = disk_to_dev(disk);
        int ret;
 
+       /* Only makes sense for bio-based to set ->poll_bio */
+       if (queue_is_mq(disk->queue) && disk->fops->poll_bio)
+               return -EINVAL;
+
        /*
         * The disk queue should now be all set with enough information about
         * the device for the elevator code to pick an adequate default