|
|
@@ -198,7 +198,7 @@ STORE(__cached_dev)
|
|
|
{
|
|
|
struct cached_dev *dc = container_of(kobj, struct cached_dev,
|
|
|
disk.kobj);
|
|
|
- ssize_t v = size;
|
|
|
+ ssize_t v;
|
|
|
struct cache_set *c;
|
|
|
struct kobj_uevent_env *env;
|
|
|
|
|
|
@@ -275,6 +275,7 @@ STORE(__cached_dev)
|
|
|
if (bch_parse_uuid(buf, dc->sb.set_uuid) < 16)
|
|
|
return -EINVAL;
|
|
|
|
|
|
+ v = -ENOENT;
|
|
|
list_for_each_entry(c, &bch_cache_sets, list) {
|
|
|
v = bch_cached_dev_attach(dc, c);
|
|
|
if (!v)
|
|
|
@@ -282,7 +283,7 @@ STORE(__cached_dev)
|
|
|
}
|
|
|
|
|
|
pr_err("Can't attach %s: cache set not found", buf);
|
|
|
- size = v;
|
|
|
+ return v;
|
|
|
}
|
|
|
|
|
|
if (attr == &sysfs_detach && dc->disk.c)
|