]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-5.10/dm-snapshot-fix-lockup-in-dm_exception_table_exit.patch
5.10-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.10 / dm-snapshot-fix-lockup-in-dm_exception_table_exit.patch
CommitLineData
b7ca0ba0
SL
1From d34dc105da100e9ea5d00a6b7a2f6d4cd1302f9a Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sashal@kernel.org>
3Date: Wed, 20 Mar 2024 18:43:11 +0100
4Subject: dm snapshot: fix lockup in dm_exception_table_exit
5
6From: Mikulas Patocka <mpatocka@redhat.com>
7
8[ Upstream commit 6e7132ed3c07bd8a6ce3db4bb307ef2852b322dc ]
9
10There was reported lockup when we exit a snapshot with many exceptions.
11Fix this by adding "cond_resched" to the loop that frees the exceptions.
12
13Reported-by: John Pittman <jpittman@redhat.com>
14Cc: stable@vger.kernel.org
15Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
16Signed-off-by: Mike Snitzer <snitzer@kernel.org>
17Signed-off-by: Sasha Levin <sashal@kernel.org>
18---
19 drivers/md/dm-snap.c | 4 +++-
20 1 file changed, 3 insertions(+), 1 deletion(-)
21
22diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
23index 41735a25d50aa..de73fe79640fd 100644
24--- a/drivers/md/dm-snap.c
25+++ b/drivers/md/dm-snap.c
26@@ -685,8 +685,10 @@ static void dm_exception_table_exit(struct dm_exception_table *et,
27 for (i = 0; i < size; i++) {
28 slot = et->table + i;
29
30- hlist_bl_for_each_entry_safe(ex, pos, n, slot, hash_list)
31+ hlist_bl_for_each_entry_safe(ex, pos, n, slot, hash_list) {
32 kmem_cache_free(mem, ex);
33+ cond_resched();
34+ }
35 }
36
37 vfree(et->table);
38--
392.43.0
40