Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deadlock between zfs umount & snapentry_expire
zfs umount -> zfsctl_destroy() takes zfs_snapshot_lock WRITER & calls zfsctl_snapshot_unmount_cancel() which waits for snapentry_expire() if present(only when snap is automounted). This snapentry_expire() itself then waits for zfs_snapshot_lock READER, resulting in a deadlock. Fix is, in zfsctl_destroy() do avl_tree lookup & removal with WRITER zfs_snapshot_lock & leave this lock before zfsctl_snapshot_unmount_cancel() call, since the validity of se is protected by se->se_refcount. Also remove the corresponding lock assertion from zfsctl_snapshot_unmount_cancel() too. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rohan Puri <rohan.puri15@gmail.com> Closes openzfs#7751
- Loading branch information