Skip to content

Commit

Permalink
dm thin metadata: decrement counter after removing mapped block
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Thornber authored and Alasdair G Kergon committed Mar 7, 2012
1 parent 4469a5f commit af63bcb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/dm-thin-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af63bcb

Please sign in to comment.