aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/module/os/linux
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2020-08-28 18:53:45 +0000
committerMatt Macy <mmacy@FreeBSD.org>2020-08-28 18:53:45 +0000
commitac0bf12ee5181e3f784b5bb87d60fc5321ebce2d (patch)
tree1201198222ad94274305aef3766d4cdaeb242cf8 /sys/contrib/openzfs/module/os/linux
parent341ccc993cf6da5ccdb1bc3f457d3c6eb2cb4d49 (diff)
parent93ddd0259dd285fbac5cc5086a039a22f1b046a1 (diff)
downloadsrc-ac0bf12ee5181e3f784b5bb87d60fc5321ebce2d.tar.gz
src-ac0bf12ee5181e3f784b5bb87d60fc5321ebce2d.zip
ZFS: MFV 2.0-rc1-ga00c61
Notes
Notes: svn path=/head/; revision=364930
Diffstat (limited to 'sys/contrib/openzfs/module/os/linux')
-rw-r--r--sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c b/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c
index c2748ce450b4..26e785a0d422 100644
--- a/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c
+++ b/sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c
@@ -31,6 +31,7 @@
* Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2018 George Melikov. All Rights Reserved.
* Copyright (c) 2019 Datto, Inc. All rights reserved.
+ * Copyright (c) 2020 The MathWorks, Inc. All rights reserved.
*/
/*
@@ -978,6 +979,22 @@ out:
}
/*
+ * Flush everything out of the kernel's export table and such.
+ * This is needed as once the snapshot is used over NFS, its
+ * entries in svc_export and svc_expkey caches hold reference
+ * to the snapshot mount point. There is no known way of flushing
+ * only the entries related to the snapshot.
+ */
+static void
+exportfs_flush(void)
+{
+ char *argv[] = { "/usr/sbin/exportfs", "-f", NULL };
+ char *envp[] = { NULL };
+
+ (void) call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
+}
+
+/*
* Attempt to unmount a snapshot by making a call to user space.
* There is no assurance that this can or will succeed, is just a
* best effort. In the case where it does fail, perhaps because
@@ -999,6 +1016,8 @@ zfsctl_snapshot_unmount(char *snapname, int flags)
}
rw_exit(&zfs_snapshot_lock);
+ exportfs_flush();
+
if (flags & MNT_FORCE)
argv[4] = "-fn";
argv[5] = se->se_path;