Skip to content

Commit 426d07d

Browse files
rincebrainbehlendorf
authored andcommitted
quick fix for lingering snapdir unmount problems
Unfortunately, even after e79b680, I still, much more rarely, tripped asserts when playing with many ctldir mounts at once. Since this appears to happen if we dispatched twice too fast, just ignore it. We don't actually need to do anything if someone already started doing it for us. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #14462
1 parent 692f780 commit 426d07d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

module/os/linux/zfs/zfs_ctldir.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,20 @@ zfsctl_snapshot_unmount_delay_impl(zfs_snapentry_t *se, int delay)
392392

393393
zfsctl_snapshot_hold(se);
394394
rw_enter(&se->se_taskqid_lock, RW_WRITER);
395-
ASSERT3S(se->se_taskqid, ==, TASKQID_INVALID);
395+
/*
396+
* If this condition happens, we managed to:
397+
* - dispatch once
398+
* - want to dispatch _again_ before it returned
399+
*
400+
* So let's just return - if that task fails at unmounting,
401+
* we'll eventually dispatch again, and if it succeeds,
402+
* no problem.
403+
*/
404+
if (se->se_taskqid != TASKQID_INVALID) {
405+
rw_exit(&se->se_taskqid_lock);
406+
zfsctl_snapshot_rele(se);
407+
return;
408+
}
396409
se->se_taskqid = taskq_dispatch_delay(system_delay_taskq,
397410
snapentry_expire, se, TQ_SLEEP, ddi_get_lbolt() + delay * HZ);
398411
rw_exit(&se->se_taskqid_lock);

0 commit comments

Comments
 (0)