dm writecache: correct uncommitted_block when discarding uncommitted entry
commit 39495b12ef1cf602e6abd350dce2ef4199906531 upstream. When uncommitted entry has been discarded, correct wc->uncommitted_block for getting the exact number. Fixes: 48debafe4f2fe ("dm: add writecache target") Cc: stable@vger.kernel.org Signed-off-by: Huaisheng Ye <yehs1@lenovo.com> Acked-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
de1d70dad6
commit
a51e71cbf6
@ -805,6 +805,8 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_
|
||||
writecache_wait_for_ios(wc, WRITE);
|
||||
discarded_something = true;
|
||||
}
|
||||
if (!writecache_entry_is_committed(wc, e))
|
||||
wc->uncommitted_blocks--;
|
||||
writecache_free_entry(wc, e);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user