dm snapshot: fix lockup in dm_exception_table_exit

JIRA: https://issues.redhat.com/browse/RHEL-34599
Upstream Status: kernel/git/torvalds/linux.git

commit 6e7132ed3c07bd8a6ce3db4bb307ef2852b322dc
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Wed Mar 20 18:43:11 2024 +0100

    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>

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
This commit is contained in:
Benjamin Marzinski 2024-04-29 18:07:43 -04:00
parent e721601dc3
commit eb3d358609
1 changed files with 3 additions and 1 deletions

View File

@ -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);