diff options
author | Tim Chase <[email protected]> | 2015-03-30 22:43:29 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-04-03 11:38:59 -0700 |
commit | 40d06e3c78c23b199dfd9284809e710fab549391 (patch) | |
tree | 77de486d62f5eabf458b251504bf47104b6f1bf1 /module/zfs/zfs_znode.c | |
parent | 74aa2ba259e61512bd029c9e8f857f0611a80bbd (diff) |
Mark all ZPL and ioctl functions as PF_FSTRANS
Prevent deadlocks by disabling direct reclaim during all ZPL and ioctl
calls as well as the l2arc and adapt ARC threads.
This obviates the need for MUTEX_FSTRANS so its previous uses and
definition have been eliminated.
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3225
Diffstat (limited to 'module/zfs/zfs_znode.c')
-rw-r--r-- | module/zfs/zfs_znode.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index a96ac8338..c931a72c3 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -1097,23 +1097,13 @@ zfs_zinactive(znode_t *zp) { zfs_sb_t *zsb = ZTOZSB(zp); uint64_t z_id = zp->z_id; - boolean_t drop_mutex = 0; ASSERT(zp->z_sa_hdl); /* * Don't allow a zfs_zget() while were trying to release this znode. - * - * Linux allows direct memory reclaim which means that any KM_SLEEP - * allocation may trigger inode eviction. This can lead to a deadlock - * through the ->shrink_icache_memory()->evict()->zfs_inactive()-> - * zfs_zinactive() call path. To avoid this deadlock the process - * must not reacquire the mutex when it is already holding it. */ - if (!ZFS_OBJ_HOLD_OWNED(zsb, z_id)) { - ZFS_OBJ_HOLD_ENTER(zsb, z_id); - drop_mutex = 1; - } + ZFS_OBJ_HOLD_ENTER(zsb, z_id); mutex_enter(&zp->z_lock); @@ -1124,8 +1114,7 @@ zfs_zinactive(znode_t *zp) if (zp->z_unlinked) { mutex_exit(&zp->z_lock); - if (drop_mutex) - ZFS_OBJ_HOLD_EXIT(zsb, z_id); + ZFS_OBJ_HOLD_EXIT(zsb, z_id); zfs_rmnode(zp); return; @@ -1134,8 +1123,7 @@ zfs_zinactive(znode_t *zp) mutex_exit(&zp->z_lock); zfs_znode_dmu_fini(zp); - if (drop_mutex) - ZFS_OBJ_HOLD_EXIT(zsb, z_id); + ZFS_OBJ_HOLD_EXIT(zsb, z_id); } static inline int |