changeset 4331:f784727d3d6a

6537472 If zfs unmount fails it leaves the file system unshared.
author th199096
date Sat, 26 May 2007 19:40:51 -0700
parents dfd7c5e23fa0
children ba42ba9a9eac
files usr/src/lib/libzfs/common/libzfs_mount.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libzfs/common/libzfs_mount.c	Sat May 26 05:29:40 2007 -0700
+++ b/usr/src/lib/libzfs/common/libzfs_mount.c	Sat May 26 19:40:51 2007 -0700
@@ -342,9 +342,12 @@
 		/*
 		 * Unshare and unmount the filesystem
 		 */
-		if (zfs_unshare_nfs(zhp, mntpt) != 0 ||
-		    unmount_one(zhp->zfs_hdl, mntpt, flags) != 0) {
+		if (zfs_unshare_nfs(zhp, mntpt) != 0)
+			return (-1);
+
+		if (unmount_one(zhp->zfs_hdl, mntpt, flags) != 0) {
 			free(mntpt);
+			zfs_share_nfs(zhp);
 			return (-1);
 		}
 		free(mntpt);