bcache: add more error message in bch_cached_dev_attach()
authorColy Li <colyli@suse.de>
Fri, 28 Jun 2019 11:59:38 +0000 (19:59 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jun 2019 13:39:15 +0000 (07:39 -0600)
This patch adds more error message for attaching cached device, this is
helpful to debug code failure during bache device start up.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/super.c

index d4d8d1300fafad13547578538214f35815045534..a836910ef368cb5b8d080c243e42b6ad2b9cdfc4 100644 (file)
@@ -1169,6 +1169,8 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
        down_write(&dc->writeback_lock);
        if (bch_cached_dev_writeback_start(dc)) {
                up_write(&dc->writeback_lock);
+               pr_err("Couldn't start writeback facilities for %s",
+                      dc->disk.disk->disk_name);
                return -ENOMEM;
        }
 
@@ -1182,6 +1184,8 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
        ret = bch_cached_dev_run(dc);
        if (ret && (ret != -EBUSY)) {
                up_write(&dc->writeback_lock);
+               pr_err("Couldn't run cached device %s",
+                      dc->backing_dev_name);
                return ret;
        }