summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-12-10 15:47:18 -0800
committerNed Bass <[email protected]>2015-12-23 17:29:34 -0800
commit8bdac257b864f110e3abd873f152cad24a696089 (patch)
tree8b6a4942f87afcbc34f477afb72b68e884daffa0
parenta0b4635fb06dd0252c8d59125fc272e0b954800e (diff)
Fix zfsctl_lookup_objset() deadlock
The zfsctl_snapshot_unmount_delay() function must not be called from zfsctl_lookup_objset() while it is currently holding the zfs_snapshot_lock. This will result in a deadlock. It is safe to call zfsctl_snapshot_unmount_delay_impl() directly because the function already has a reference on the zfs_snapentry_t. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #3997
-rw-r--r--module/zfs/zfs_ctldir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c
index 572e9652a..fc46a7307 100644
--- a/module/zfs/zfs_ctldir.c
+++ b/module/zfs/zfs_ctldir.c
@@ -1190,7 +1190,8 @@ zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp)
if (time_after(jiffies, zsb->z_snap_defer_time +
MAX(zfs_expire_snapshot * HZ / 2, HZ))) {
zsb->z_snap_defer_time = jiffies;
- zfsctl_snapshot_unmount_delay(spa, objsetid,
+ zfsctl_snapshot_unmount_cancel(se);
+ zfsctl_snapshot_unmount_delay_impl(se,
zfs_expire_snapshot);
}