From c8af0886c3b7ce419275e215003b0b19370f708b Mon Sep 17 00:00:00 2001
From: will <will@FreeBSD.org>
Date: Thu, 26 May 2011 16:27:00 +0000
Subject: Close a race between libzfs and mountd when updating NFS exports. -
 Flush the file descriptor for the new ZFS exports file before   sending a
 SIGHUP to mountd.

Reviewed by:	pjd
Approved by:	ken
MFC after:	3 days
---
 cddl/compat/opensolaris/misc/fsshare.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'cddl/compat/opensolaris/misc/fsshare.c')

diff --git a/cddl/compat/opensolaris/misc/fsshare.c b/cddl/compat/opensolaris/misc/fsshare.c
index e8faa92..c3247f9 100644
--- a/cddl/compat/opensolaris/misc/fsshare.c
+++ b/cddl/compat/opensolaris/misc/fsshare.c
@@ -223,6 +223,7 @@ out:
 			error = errno;
 			unlink(tmpfile);
 		} else {
+			fflush(newfd);
 			/*
 			 * Send SIGHUP to mountd, but unlock exports file later.
 			 */
-- 
cgit v1.1