md: md.c: Return -ENODEV when mddev is NULL in rdev_attr_show
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Fri, 14 Jun 2019 22:41:06 +0000 (15:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 15 Jun 2019 07:37:34 +0000 (01:37 -0600)
Commit c42d3240990814eec1e4b2b93fa0487fc4873aed
("md: return -ENODEV if rdev has no mddev assigned") changed
rdev_attr_store to return -ENODEV when rdev->mddev is NULL, now do the
same to rdev_attr_show.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/md.c

index 04f4f131f9d6d4410b4c63dec1a4ae1f009995c0..86f4f2b5a724c0578c21445505c8fe9188672363 100644 (file)
@@ -3356,7 +3356,7 @@ rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
        if (!entry->show)
                return -EIO;
        if (!rdev->mddev)
-               return -EBUSY;
+               return -ENODEV;
        return entry->show(rdev, page);
 }