From: Joe Thornber Date: Wed, 7 Mar 2012 19:09:44 +0000 (+0000) Subject: dm thin metadata: decrement counter after removing mapped block X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=af63bcb817cf708f53bcae6edc2e3fb7dd7d8051;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git dm thin metadata: decrement counter after removing mapped block Correct the number of mapped sectors shown on a thin device's status line by decrementing td->mapped_blocks in __remove() each time a block is removed. Signed-off-by: Joe Thornber Acked-by: Mike Snitzer Cc: stable@kernel.org Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-thin-metadata.c b/drivers/md/dm-thin-metadata.c index 05b7ffc030ed..237571af77fd 100644 --- a/drivers/md/dm-thin-metadata.c +++ b/drivers/md/dm-thin-metadata.c @@ -1224,6 +1224,8 @@ static int __remove(struct dm_thin_device *td, dm_block_t block) if (r) return r; + td->mapped_blocks--; + td->changed = 1; pmd->need_commit = 1; return 0;