diff options
author | Huaisheng Ye <yehs1@lenovo.com> | 2020-06-12 17:59:11 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2020-06-17 18:25:41 +0200 |
commit | 39495b12ef1cf602e6abd350dce2ef4199906531 (patch) | |
tree | 3d3ce61f0cd9628d08a41d361bf64a958ee15e17 /drivers/md | |
parent | dm zoned: assign max_io_len correctly (diff) | |
download | linux-39495b12ef1cf602e6abd350dce2ef4199906531.tar.xz linux-39495b12ef1cf602e6abd350dce2ef4199906531.zip |
dm writecache: correct uncommitted_block when discarding uncommitted entry
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-writecache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 74f3c506f084..ddff5527dbdf 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -853,6 +853,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); } |