Skip to content

Commit 6e7132e

Browse files
Mikulas PatockaMike Snitzer
authored andcommitted
dm snapshot: fix lockup in dm_exception_table_exit
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. Reported-by: John Pittman <jpittman@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
1 parent 55e565c commit 6e7132e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/md/dm-snap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,10 @@ static void dm_exception_table_exit(struct dm_exception_table *et,
684684
for (i = 0; i < size; i++) {
685685
slot = et->table + i;
686686

687-
hlist_bl_for_each_entry_safe(ex, pos, n, slot, hash_list)
687+
hlist_bl_for_each_entry_safe(ex, pos, n, slot, hash_list) {
688688
kmem_cache_free(mem, ex);
689+
cond_resched();
690+
}
689691
}
690692

691693
kvfree(et->table);

0 commit comments

Comments
 (0)