Commit af63bcb817cf708f53bcae6edc2e3fb7dd7d8051

Authored by Joe Thornber
Committed by Alasdair G Kergon
1 parent 4469a5f387

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 <ejt@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

drivers/md/dm-thin-metadata.c
... ... @@ -1224,6 +1224,8 @@
1224 1224 if (r)
1225 1225 return r;
1226 1226  
  1227 + td->mapped_blocks--;
  1228 + td->changed = 1;
1227 1229 pmd->need_commit = 1;
1228 1230  
1229 1231 return 0;