Commit 46010141 authored by Shenghui Wang's avatar Shenghui Wang Committed by Jens Axboe

bcache: recal cached_dev_sectors on detach

Recal cached_dev_sectors on cached_dev detached, as recal done on
cached_dev attached.

Update the cached_dev_sectors before bcache_device_detach called
as bcache_device_detach will set bcache_device->c to NULL.
Signed-off-by: default avatarShenghui Wang <shhuiw@foxmail.com>
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2d6cb6ed
...@@ -1009,6 +1009,7 @@ static void cached_dev_detach_finish(struct work_struct *w) ...@@ -1009,6 +1009,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
bch_write_bdev_super(dc, &cl); bch_write_bdev_super(dc, &cl);
closure_sync(&cl); closure_sync(&cl);
calc_cached_dev_sectors(dc->disk.c);
bcache_device_detach(&dc->disk); bcache_device_detach(&dc->disk);
list_move(&dc->list, &uncached_devices); list_move(&dc->list, &uncached_devices);
......
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