summaryrefslogtreecommitdiff
path: root/drivers/md/bcache/sysfs.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2019-06-28 14:59:33 +0300
committerJens Axboe <axboe@kernel.dk>2019-06-28 16:39:14 +0300
commit0b13efecf5f25ce5e31f2ab3930335015cb65a7d (patch)
tree03280dc95522f10714145d714703c1080b011230 /drivers/md/bcache/sysfs.c
parent89e0341af082dbc170019f908846f4a424efc86b (diff)
downloadlinux-0b13efecf5f25ce5e31f2ab3930335015cb65a7d.tar.xz
bcache: add return value check to bch_cached_dev_run()
This patch adds return value check to bch_cached_dev_run(), now if there is error happens inside bch_cached_dev_run(), it can be catched. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/sysfs.c')
-rw-r--r--drivers/md/bcache/sysfs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 760cf8951338..eb678e43ac00 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -325,8 +325,11 @@ STORE(__cached_dev)
bch_cache_accounting_clear(&dc->accounting);
if (attr == &sysfs_running &&
- strtoul_or_return(buf))
- bch_cached_dev_run(dc);
+ strtoul_or_return(buf)) {
+ v = bch_cached_dev_run(dc);
+ if (v)
+ return v;
+ }
if (attr == &sysfs_cache_mode) {
v = sysfs_match_string(bch_cache_modes, buf);