Skip to content

Commit

Permalink
Fix z_teardown_inactive_lock deadlock
Browse files Browse the repository at this point in the history
When rolling back a mounted filesystem zfs_suspend() is called
which acquires the z_teardown_inactive_lock.  This lock can not
be dropped until the filesystem has been rolled back and resumed
in zfs_resume_fs().

Therefore, we must not call iput() under this lock because it
may result in the inode->evict() handler being called which also
takes this lock.  Instead use zfs_iput_async() to ensure dropping
the last reference is deferred and runs in a safe context.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#2670
  • Loading branch information
behlendorf committed Sep 11, 2014
1 parent 52dd454 commit 2d50158
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ zfs_rezget(znode_t *zp)
}

if (zp->z_xattr_parent) {
iput(ZTOI(zp->z_xattr_parent));
zfs_iput_async(ZTOI(zp->z_xattr_parent));
zp->z_xattr_parent = NULL;
}
rw_exit(&zp->z_xattr_lock);
Expand Down

0 comments on commit 2d50158

Please sign in to comment.