Commit 4b6efb4b authored by Coly Li's avatar Coly Li Committed by Jens Axboe

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: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 383ff218
...@@ -693,6 +693,7 @@ static void bcache_device_link(struct bcache_device *d, struct cache_set *c, ...@@ -693,6 +693,7 @@ static void bcache_device_link(struct bcache_device *d, struct cache_set *c,
{ {
unsigned int i; unsigned int i;
struct cache *ca; struct cache *ca;
int ret;
for_each_cache(ca, d->c, i) for_each_cache(ca, d->c, i)
bd_link_disk_holder(ca->bdev, d->disk); 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, ...@@ -700,9 +701,13 @@ static void bcache_device_link(struct bcache_device *d, struct cache_set *c,
snprintf(d->name, BCACHEDEVNAME_SIZE, snprintf(d->name, BCACHEDEVNAME_SIZE,
"%s%u", name, d->id); "%s%u", name, d->id);
WARN(sysfs_create_link(&d->kobj, &c->kobj, "cache") || ret = sysfs_create_link(&d->kobj, &c->kobj, "cache");
sysfs_create_link(&c->kobj, &d->kobj, d->name), if (ret < 0)
"Couldn't create device <-> cache set symlinks"); 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); clear_bit(BCACHE_DEV_UNLINK_DONE, &d->flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment