mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 21:15:53 +02:00
bcache: correct dirty data statistics
commit 2e17a262a2 upstream.
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
32870e2bb6
commit
9e9f19efcb
|
|
@ -1148,11 +1148,12 @@ 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);
|
||||
bch_writeback_queue(dc);
|
||||
}
|
||||
|
||||
bch_sectors_dirty_init(&dc->disk);
|
||||
|
||||
bch_cached_dev_run(dc);
|
||||
bcache_device_link(&dc->disk, c, "bdev");
|
||||
atomic_inc(&c->attached_dev_nr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user