summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/super.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2019-06-28 13:59:37 +0200
committerJens Axboe <axboe@kernel.dk>2019-06-28 15:39:15 +0200
commit4b6efb4bdbce25097f1a6329e18c2b77c4f27722 (patch)
tree048a928e30df944dc7767d57b630730ef2c8ee83 /drivers/md/bcache/super.c
parentbcache: check CACHE_SET_IO_DISABLE bit in bch_journal() (diff)
downloadlinux-4b6efb4bdbce25097f1a6329e18c2b77c4f27722.tar.xz
linux-4b6efb4bdbce25097f1a6329e18c2b77c4f27722.zip
bcache: more detailed error message to bcache_device_link()
This patch adds more accurate error message for specific ssyfs_create_link() call, to help debugging failure during bcache device start tup. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--drivers/md/bcache/super.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 0abee44092bf..d4d8d1300faf 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -693,6 +693,7 @@ static void bcache_device_link(struct bcache_device *d, struct cache_set *c,
{
unsigned int i;
struct cache *ca;
+ int ret;
for_each_cache(ca, d->c, i)
bd_link_disk_holder(ca->bdev, d->disk);
@@ -700,9 +701,13 @@ static void bcache_device_link(struct bcache_device *d, struct cache_set *c,
snprintf(d->name, BCACHEDEVNAME_SIZE,
"%s%u", name, d->id);
- WARN(sysfs_create_link(&d->kobj, &c->kobj, "cache") ||
- sysfs_create_link(&c->kobj, &d->kobj, d->name),
- "Couldn't create device <-> cache set symlinks");
+ ret = sysfs_create_link(&d->kobj, &c->kobj, "cache");
+ if (ret < 0)
+ pr_err("Couldn't create device -> cache set symlink");
+
+ ret = sysfs_create_link(&c->kobj, &d->kobj, d->name);
+ if (ret < 0)
+ pr_err("Couldn't create cache set -> device symlink");
clear_bit(BCACHE_DEV_UNLINK_DONE, &d->flags);
}