Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af63bcb8 authored by Joe Thornber's avatar Joe Thornber Committed by Alasdair G Kergon
Browse files

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: default avatarJoe Thornber <ejt@redhat.com>
Acked-by: default avatarMike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 4469a5f3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;