aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bcache/sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 4a6a697e1680..a7552f509f50 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -198,7 +198,7 @@ STORE(__cached_dev)
198{ 198{
199 struct cached_dev *dc = container_of(kobj, struct cached_dev, 199 struct cached_dev *dc = container_of(kobj, struct cached_dev,
200 disk.kobj); 200 disk.kobj);
201 ssize_t v = size; 201 ssize_t v;
202 struct cache_set *c; 202 struct cache_set *c;
203 struct kobj_uevent_env *env; 203 struct kobj_uevent_env *env;
204 204
@@ -275,6 +275,7 @@ STORE(__cached_dev)
275 if (bch_parse_uuid(buf, dc->sb.set_uuid) < 16) 275 if (bch_parse_uuid(buf, dc->sb.set_uuid) < 16)
276 return -EINVAL; 276 return -EINVAL;
277 277
278 v = -ENOENT;
278 list_for_each_entry(c, &bch_cache_sets, list) { 279 list_for_each_entry(c, &bch_cache_sets, list) {
279 v = bch_cached_dev_attach(dc, c); 280 v = bch_cached_dev_attach(dc, c);
280 if (!v) 281 if (!v)
@@ -282,7 +283,7 @@ STORE(__cached_dev)
282 } 283 }
283 284
284 pr_err("Can't attach %s: cache set not found", buf); 285 pr_err("Can't attach %s: cache set not found", buf);
285 size = v; 286 return v;
286 } 287 }
287 288
288 if (attr == &sysfs_detach && dc->disk.c) 289 if (attr == &sysfs_detach && dc->disk.c)