bcache: recal cached_dev_sectors on detach
authorShenghui Wang <shhuiw@foxmail.com>
Mon, 8 Oct 2018 12:41:15 +0000 (20:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:38 +0000 (08:20 +0100)
commit04d38fa8436b8e6df1c5d35709d3cae4485d66a9
treec034341a151eb3ff91beb30c2c54e4024eb1bb83
parent65910055b56077cd54277a115d5ff67469c21683
bcache: recal cached_dev_sectors on detach

[ Upstream commit 46010141da6677b81cc77f9b47f8ac62bd1cbfd3 ]

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: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/bcache/super.c