From a194c9f7090b59b6fd137d25fe5d6a5bf3461042 Mon Sep 17 00:00:00 2001 From: Will Andrews Date: Thu, 26 May 2011 16:27:00 +0000 Subject: [PATCH] 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(+) diff --git a/cddl/compat/opensolaris/misc/fsshare.c b/cddl/compat/opensolaris/misc/fsshare.c index e8faa928d6fb..c3247f91fec4 100644 --- a/cddl/compat/opensolaris/misc/fsshare.c +++ b/cddl/compat/opensolaris/misc/fsshare.c @@ -223,6 +223,7 @@ fsshare_main(const char *file, const char *mountpoint, const char *shareopts, error = errno; unlink(tmpfile); } else { + fflush(newfd); /* * Send SIGHUP to mountd, but unlock exports file later. */