dm snapshot: add cond_resched to dm_exception_table_exit
Mikulas Patocka
maintainerPATCH 1/1 dm snapshot: add cond_resched to 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.
Signed-off-by Mikulas Patocka <[email protected]>
--- drivers/md/dm-snap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/dm-snap.c +3 -1
@@ -684,8 +684,10 @@ static void dm_exception_table_exit(strufor (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);