]> git.ipfire.org Git - people/arne_f/kernel.git/commit
bcache: account size of buckets used in uuid write to ca->meta_sectors_written
authorShenghui Wang <shhuiw@foxmail.com>
Mon, 8 Oct 2018 12:41:07 +0000 (20:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:38 +0000 (08:20 +0100)
commit65910055b56077cd54277a115d5ff67469c21683
tree02a21fa265ab7311eeddf542edea2697aec95201
parent16c2d36b11239b0f8f03818764d7c94aa4abd542
bcache: account size of buckets used in uuid write to ca->meta_sectors_written

[ Upstream commit 7a55948d38eb9b274cbbdd56dc1dd4b96ebfbe04 ]

UUIDs are considered as metadata. __uuid_write should add the number
of buckets (in sectors) written to disk to ca->meta_sectors_written.
Currently only 1 bucket is used in uuid write.

Steps to test:
1) create a fresh backing device and a fresh cache device separately.
   The backing device didn't attach to any cache set.
2) cd /sys/block/<cache device>/bcache
   cat metadata_written      // record the output value
   cat bucket_size
3) attach the backing device to cache set
4) cat metadata_written
   The output value is almost the same as the value in step 2
   before the change.
   After the change, the value is bigger about 1 bucket size.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Reviewed-by: Tang Junhui <tang.junhui.linux@gmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/bcache/super.c