]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Workaround issue cleaning up automounted snapshots on Linux
authorRich Ercolani <214141+rincebrain@users.noreply.github.com>
Wed, 3 Nov 2021 15:00:08 +0000 (11:00 -0400)
committerGitHub <noreply@github.com>
Wed, 3 Nov 2021 15:00:08 +0000 (09:00 -0600)
commite79b6807b8a9839dd3ced71376dc143e24949fb1
treea89450a9cfe0bdac7e7ff9050a1ce7d12f5fd3a6
parenta2ffc0e0254116294f42614e18fed36cefbbf3ba
Workaround issue cleaning up automounted snapshots on Linux

On Linux, sometimes, when ZFS goes to unmount an automounted snap,
it fails a VERIFY check on debug builds, because taskq_cancel_id
returned ENOENT after not finding the taskq it was trying to cancel.

This presumably happens when it already died for some reason; in this
case, we don't really mind it already being dead, since we're just
going to dispatch a new task to unmount it right after.

So we just ignore it if we get back ENOENT trying to cancel here,
retry a couple times if we get back the only other possible condition
(EBUSY), and log to dbgmsg if we got anything but ENOENT or success.

(We also add some locking around taskqid, to avoid one or two cases
of two instances of trying to cancel something at once.)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #11632
Closes #12670
module/os/linux/zfs/zfs_ctldir.c