From 245b7ab3d1c06efe5b76a9412996fac50aa77f72 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Dec 2015 10:59:25 -0800 Subject: Hold the zfs_snapentry_t before dispatch While exceptionally unlikely to cause a problem the zfs_snapentry_t hold should be taken before the dispatch to prevent any possibility of the task being processed before the hold. Signed-off-by: Brian Behlendorf Signed-off-by: Chunwei Chen --- module/zfs/zfs_ctldir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/zfs') diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c index 969d6049d..fc46a7307 100644 --- a/module/zfs/zfs_ctldir.c +++ b/module/zfs/zfs_ctldir.c @@ -381,9 +381,9 @@ zfsctl_snapshot_unmount_delay_impl(zfs_snapentry_t *se, int delay) if (delay <= 0) return; + zfsctl_snapshot_hold(se); se->se_taskqid = taskq_dispatch_delay(zfs_expire_taskq, snapentry_expire, se, TQ_SLEEP, ddi_get_lbolt() + delay * HZ); - zfsctl_snapshot_hold(se); } /* -- cgit v1.2.3