From cb98d1ef271cf870d4b3d2fa419f80eb3621c313 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Dec 2015 10:59:25 -0800 Subject: [PATCH] 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(-) diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c index 0bfbd75434..572e9652a7 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); } /*