diff options
| author | Shenghui Wang <shhuiw@foxmail.com> | 2018-10-08 08:41:15 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-10-08 10:19:50 -0400 |
| commit | 46010141da6677b81cc77f9b47f8ac62bd1cbfd3 (patch) | |
| tree | 0af7066c93413a5504498ca0010b7705ef4a56b1 /drivers/md/bcache | |
| parent | 2d6cb6edd2c7fb4f40998895bda45006281b1ac5 (diff) | |
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: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache')
| -rw-r--r-- | drivers/md/bcache/super.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index c116b6e0d85a..1155bd823b6f 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
| @@ -1009,6 +1009,7 @@ static void cached_dev_detach_finish(struct work_struct *w) | |||
| 1009 | bch_write_bdev_super(dc, &cl); | 1009 | bch_write_bdev_super(dc, &cl); |
| 1010 | closure_sync(&cl); | 1010 | closure_sync(&cl); |
| 1011 | 1011 | ||
| 1012 | calc_cached_dev_sectors(dc->disk.c); | ||
| 1012 | bcache_device_detach(&dc->disk); | 1013 | bcache_device_detach(&dc->disk); |
| 1013 | list_move(&dc->list, &uncached_devices); | 1014 | list_move(&dc->list, &uncached_devices); |
| 1014 | 1015 | ||
