Skip to contentSkip to conversation

md: md.c: Return -ENODEV when mddev is NULL in rdev_attr_show

PATCH In review Marcos Paulo de Souza 2 participants 2 messages May 24, 2019 – Jun 6, 2019 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md: md.c: Return -ENODEV when mddev is NULL in rdev_attr_show

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.

---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
index 45ffa23fa85d..0b391e7e063b 100644
@@ -3363,7 +3363,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);
 }
 
Signature · 1 line
2.21.0
#1 lore raw
Quoted 4 lines · Marcos Paulo de Souza

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.

nit: checkpatch.pl complains

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#84:
("md: return -ENODEV if rdev has no mddev assigned") changed rdev_attr_store to

I fixed this in my tree, so no need to resend.

Thanks,
Song

Quoted 22 lines
---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -2
index 45ffa23fa85d..0b391e7e063b 100644
@@ -3363,7 +3363,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);
 }
 
--

2.21.0