Thread (20 messages) 20 messages, 2 authors, 2018-10-08
STALE2819d

[PATCH 09/15] bcache: recal cached_dev_sectors on detach

From: Coly Li <hidden>
Date: 2018-10-08 12:41:15
Subsystem: bcache (block layer cache), the rest · Maintainers: Coly Li, Kent Overstreet, Linus Torvalds

From: Shenghui Wang <redacted>

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 <redacted>
Signed-off-by: Coly Li <redacted>
---
 drivers/md/bcache/super.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 4989c7d4d4d0..dc392a485269 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1008,6 +1008,7 @@ static void cached_dev_detach_finish(struct work_struct *w)
 	bch_write_bdev_super(dc, &cl);
 	closure_sync(&cl);
 
+	calc_cached_dev_sectors(dc->disk.c);
 	bcache_device_detach(&dc->disk);
 	list_move(&dc->list, &uncached_devices);
 
-- 
2.19.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help