mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
bcache: correct dirty data statistics
[ Upstream commit 2e17a262a2 ]
When bcache device is clean, dirty keys may still exist after
journal replay, so we need to count these dirty keys even
device in clean status, otherwise after writeback, the amount
of dirty data would be incorrect.
Signed-off-by: Tang Junhui <tang.junhui.linux@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c4d262c26e
commit
ba4e742ac0
@@ -1045,12 +1045,13 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c,
|
||||
}
|
||||
|
||||
if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) {
|
||||
bch_sectors_dirty_init(&dc->disk);
|
||||
atomic_set(&dc->has_dirty, 1);
|
||||
atomic_inc(&dc->count);
|
||||
bch_writeback_queue(dc);
|
||||
}
|
||||
|
||||
bch_sectors_dirty_init(&dc->disk);
|
||||
|
||||
bch_cached_dev_run(dc);
|
||||
bcache_device_link(&dc->disk, c, "bdev");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user