mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Don't allow shrinking a PF_FSTRANS context
Avoid deadlocks when entering the shrinker from a PF_FSTRANS context.
This patch also reverts commit d0d5dd7 which added MUTEX_FSTRANS. Its
use has been deprecated within ZFS as it was an ineffective mechanism
to eliminate deadlocks. Among other things, it introduced the need for
strict ordering of mutex locking and unlocking in order that the
PF_FSTRANS flag wouldn't set incorrectly.
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #446
This commit is contained in:
committed by
Brian Behlendorf
parent
c089961110
commit
ae26dd0039
@@ -1574,6 +1574,12 @@ __spl_kmem_cache_generic_shrinker(struct shrinker *shrink,
|
||||
spl_kmem_cache_t *skc;
|
||||
int alloc = 0;
|
||||
|
||||
/*
|
||||
* No shrinking in a transaction context. Can cause deadlocks.
|
||||
*/
|
||||
if (sc->nr_to_scan && spl_fstrans_check())
|
||||
return (SHRINK_STOP);
|
||||
|
||||
down_read(&spl_kmem_cache_sem);
|
||||
list_for_each_entry(skc, &spl_kmem_cache_list, skc_list) {
|
||||
if (sc->nr_to_scan) {
|
||||
|
||||
Reference in New Issue
Block a user