summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-12-10 15:47:18 -0800
committerBrian Behlendorf <[email protected]>2015-12-14 12:05:52 -0800
commitf22f900f15c28ebd8b8b764ee6229a7069c74a13 (patch)
tree314e13364c81a11600228f02b2a68c2dd3b760ed /module/zfs
parent5e94284fe57ba0b3b5825676e3fd498c8b4b8115 (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
Diffstat (limited to 'module/zfs')
-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 a00d61d1a..0bf530c96 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);
}