[PATCH] genhd: register_disk: inform about dev_set_name() failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Although dev_set_name() failure is not fatal, it is better to print
a warning message into dmesg about it.

Signed-off-by: Eugene Korenevsky <ekorenevsky@xxxxxxxxx>
---
 block/genhd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index f1543a45e73b..071f8cbd529a 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -577,7 +577,9 @@ static void register_disk(struct device *parent, struct gendisk *disk)
 
 	ddev->parent = parent;
 
-	dev_set_name(ddev, "%s", disk->disk_name);
+	err = dev_set_name(ddev, "%s", disk->disk_name);
+	if (err)
+		pr_warn("%s: cannot set disk name: %d", __func__, err);
 
 	/* delay uevents, until we scanned partition table */
 	dev_set_uevent_suppress(ddev, 1);
-- 
2.18.0




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux