This is a note to let you know that I've just added the patch titled bcache: correct dirty data statistics to the 4.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bcache-correct-dirty-data-statistics.patch and it can be found in the queue-4.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 2e17a262a2371d38d2ec03614a2675a32cef9912 Mon Sep 17 00:00:00 2001 From: Tang Junhui <tang.junhui.linux@xxxxxxxxx> Date: Mon, 8 Oct 2018 20:41:12 +0800 Subject: bcache: correct dirty data statistics From: Tang Junhui <tang.junhui.linux@xxxxxxxxx> commit 2e17a262a2371d38d2ec03614a2675a32cef9912 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@xxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Coly Li <colyli@xxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/bcache/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1131,11 +1131,12 @@ int bch_cached_dev_attach(struct cached_ } 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"); Patches currently in stable-queue which might be from tang.junhui.linux@xxxxxxxxx are queue-4.18/bcache-trace-missed-reading-by-cache_missed.patch queue-4.18/bcache-fix-miss-key-refill-end-in-writeback.patch queue-4.18/bcache-correct-dirty-data-statistics.patch