From: Joe Thornber <[email-masked]>

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 <[email-masked]>
Acked-by: Mike Snitzer <[email-masked]>
Cc: [email-masked]
Signed-off-by: Alasdair G Kergon <[email-masked]>

---
 drivers/md/dm-thin-metadata.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-3.3-rc6/drivers/md/dm-thin-metadata.c
===================================================================
--- linux-3.3-rc6.orig/drivers/md/dm-thin-metadata.c
+++ linux-3.3-rc6/drivers/md/dm-thin-metadata.c
@@ -1224,6 +1224,8 @@ static int __remove(struct dm_thin_devic
 	if (r)
 		return r;
 
+	td->mapped_blocks--;
+	td->changed = 1;
 	pmd->need_commit = 1;
 
 	return 0;