diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2024-03-20 18:43:11 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2024-03-20 19:31:24 +0100 |
commit | 6e7132ed3c07bd8a6ce3db4bb307ef2852b322dc (patch) | |
tree | 25364fb73f453ce9369b1951b419f3b06b36955f /drivers/md/dm-snap.c | |
parent | dm-integrity: fix a memory leak when rechecking the data (diff) | |
download | linux-6e7132ed3c07bd8a6ce3db4bb307ef2852b322dc.tar.xz linux-6e7132ed3c07bd8a6ce3db4bb307ef2852b322dc.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/md/dm-snap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index bf7a574499a3..0ace06d1bee3 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -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); |