Searched hist:"46010141 da6677b81cc77f9b47f8ac62bd1cbfd3" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/md/bcache/ |
H A D | super.c | diff 0259d4498ba48454749ecfb9c81e892cdb8d1a32 Wed Oct 20 09:38:08 CDT 2021 Lin Feng <linf@wangsu.com> bcache: move calc_cached_dev_sectors to proper place on backing device detach
Calculation of cache_set's cached sectors is done by travelling cached_devs list as shown below:
static void calc_cached_dev_sectors(struct cache_set *c) { ... list_for_each_entry(dc, &c->cached_devs, list) sectors += bdev_sectors(dc->bdev);
c->cached_dev_sectors = sectors; }
But cached_dev won't be unlinked from c->cached_devs list until we call following list_move(&dc->list, &uncached_devices), so previous fix in 'commit 46010141da6677b81cc77f9b47f8ac62bd1cbfd3 ("bcache: recal cached_dev_sectors on detach")' is wrong, now we move it to its right place.
Signed-off-by: Lin Feng <linf@wangsu.com> Signed-off-by: Coly Li <colyli@suse.de> Link: https://lore.kernel.org/r/20211020143812.6403-5-colyli@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk> diff 46010141da6677b81cc77f9b47f8ac62bd1cbfd3 Mon Oct 08 07:41:15 CDT 2018 Shenghui Wang <shhuiw@foxmail.com> 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>
|