Skip to contentSkip to conversation

Patch "dm snapshot: fix lockup in dm_exception_table_exit" has been added to the 6.6-stable tree

PATCH Sasha Levin 1 participant 1 message Mar 27, 2024 Device mapper

lore
Share & tools
lore

Sasha Levin

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

dm snapshot: fix lockup in dm_exception_table_exit

to the 6.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
dm-snapshot-fix-lockup-in-dm_exception_table_exit.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

commit 466c692aeb78906f44b998250c9e39b3961311f5

Author: Mikulas Patocka <[email protected]>
Date:   Wed Mar 20 18:43:11 2024 +0100

dm snapshot: fix lockup in dm_exception_table_exit

[ Upstream commit 6e7132ed3c07bd8a6ce3db4bb307ef2852b322dc ]

There was reported lockup when we exit a snapshot with many exceptions. Fix this by adding "cond_resched" to the loop that frees the exceptions.

drivers/md/dm-snap.c +3 -1
index bf7a574499a34..0ace06d1bee38 100644
@@ -684,8 +684,10 @@ static void dm_exception_table_exit(struct dm_exception_table *et,
 	for (i = 0; i < size; i++) {
 		slot = et->table + i;
 
-		hlist_bl_for_each_entry_safe(ex, pos, n, slot, hash_list)
+		hlist_bl_for_each_entry_safe(ex, pos, n, slot, hash_list) {
 			kmem_cache_free(mem, ex);
+			cond_resched();
+		}
 	}
 
 	kvfree(et->table);