[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200629152523.2494198-176-sashal@kernel.org>
Date: Mon, 29 Jun 2020 11:25:20 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Huaisheng Ye <yehs1@...ovo.com>,
Mikulas Patocka <mpatocka@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH 5.4 175/178] dm writecache: correct uncommitted_block when discarding uncommitted entry
From: Huaisheng Ye <yehs1@...ovo.com>
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@...r.kernel.org
Signed-off-by: Huaisheng Ye <yehs1@...ovo.com>
Acked-by: Mikulas Patocka <mpatocka@...hat.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/md/dm-writecache.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 0d6ca723257f6..64d75bbefda11 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -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);
}
--
2.25.1
Powered by blists - more mailing lists