diff options
-rw-r--r-- | drivers/block/rbd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index a8521338bf46..28052ff679ca 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -1982,7 +1982,10 @@ static ssize_t rbd_name_show(struct device *dev, | |||
1982 | { | 1982 | { |
1983 | struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); | 1983 | struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); |
1984 | 1984 | ||
1985 | return sprintf(buf, "%s\n", rbd_dev->spec->image_name); | 1985 | if (rbd_dev->spec->image_name) |
1986 | return sprintf(buf, "%s\n", rbd_dev->spec->image_name); | ||
1987 | |||
1988 | return sprintf(buf, "(unknown)\n"); | ||
1986 | } | 1989 | } |
1987 | 1990 | ||
1988 | static ssize_t rbd_image_id_show(struct device *dev, | 1991 | static ssize_t rbd_image_id_show(struct device *dev, |