All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v1 3/3] Finish port of junction support to nfs-utils
Date: Wed, 31 Oct 2018 16:02:29 -0400	[thread overview]
Message-ID: <20181031200229.7507.26189.stgit@klimt.1015granger.net> (raw)
In-Reply-To: <20181031200218.7507.15214.stgit@klimt.1015granger.net>

CONFIG_JUNCTION was defined for use in Makefiles, but that does not
provide a -DCONFIG_JUNCTION on the compiler command line. Add logic
to configure.ac to get the compiler flags right.

Now that mountd junction support is getting built, a few last minute
porting bugs popped out. Fix those up.

Reported-by: Yongcheng Yang <yoyang@redhat.com>
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1543126
Fixes: 79978ed34973 ("mountd: Solder in support for NFS basic ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 configure.ac         |    8 +++++++-
 utils/mountd/cache.c |   18 +++++++++---------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 16eae06..b458891 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,7 +185,13 @@ AC_ARG_ENABLE(junction,
 			[enable support for NFS junctions @<:@default=no@:>@])],
 	enable_junction=$enableval,
 	enable_junction=no)
-AM_CONDITIONAL(CONFIG_JUNCTION, [test "$enable_junction" = "yes" ])
+	if test "$enable_junction" = yes; then
+		AC_DEFINE(HAVE_JUNCTION_SUPPORT, 1,
+                          [Define this if you want junction support compiled in])
+	else
+		enable_junction=
+	fi
+	AM_CONDITIONAL(CONFIG_JUNCTION, [test "$enable_junction" = "yes" ])
 
 AC_ARG_ENABLE(tirpc,
 	[AC_HELP_STRING([--disable-tirpc],
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index 6f42512..7e8d403 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -976,8 +976,9 @@ lookup_export(char *dom, char *path, struct addrinfo *ai)
 	return found;
 }
 
-#ifdef CONFIG_JUNCTION
+#ifdef HAVE_JUNCTION_SUPPORT
 
+#include <libxml/parser.h>
 #include "junction.h"
 
 struct nfs_fsloc_set {
@@ -1084,8 +1085,7 @@ static bool locations_to_fslocdata(struct nfs_fsloc_set *locations,
 	*ttl = 0;
 
 	for (;;) {
-		enum jp_status status;
-		int len;
+		int len, status;
 
 		status = get_next_location(locations, &server,
 							&rootpath, ttl);
@@ -1219,7 +1219,7 @@ nfs_get_basic_junction(const char *junct_path, struct nfs_fsloc_set **locset)
 		return EINVAL;
 	}
 
-	locset->ns_current = locset->ns_list;
+	new->ns_current = new->ns_list;
 	new->ns_ttl = 300;
 	*locset = new;
 	return 0;
@@ -1242,7 +1242,7 @@ static struct exportent *lookup_junction(char *dom, const char *pathname,
 	status = nfs_get_basic_junction(pathname, &locations);
 	switch (status) {
 		xlog(L_WARNING, "Dangling junction %s: %s",
-			pathname, strerro(status));
+			pathname, strerror(status));
 		goto out;
 	}
 
@@ -1252,8 +1252,8 @@ static struct exportent *lookup_junction(char *dom, const char *pathname,
 
 	exp = locations_to_export(locations, pathname, parent);
 
-	nfs_free_locations(locset->ns_list);
-	free(locset);
+	nfs_free_locations(locations->ns_list);
+	free(locations);
 
 out:
 	xmlCleanupParser();
@@ -1273,7 +1273,7 @@ static void lookup_nonexport(int f, char *buf, int buflen, char *dom, char *path
 	free(eep);
 }
 
-#else	/* !CONFIG_JUNCTION */
+#else	/* !HAVE_JUNCTION_SUPPORT */
 
 static void lookup_nonexport(int f, char *buf, int buflen, char *dom, char *path,
 		struct addrinfo *UNUSED(ai))
@@ -1281,7 +1281,7 @@ static void lookup_nonexport(int f, char *buf, int buflen, char *dom, char *path
 	dump_to_cache(f, buf, buflen, dom, path, NULL, 0);
 }
 
-#endif	/* !CONFIG_JUNCTION */
+#endif	/* !HAVE_JUNCTION_SUPPORT */
 
 static void nfsd_export(int f)
 {


  parent reply	other threads:[~2018-10-31 20:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 20:02 [PATCH v1 1/3] Fix quoting in configure.ac Chuck Lever
2018-10-31 20:02 ` [PATCH v1 2/3] Harden configure.ac checks for libxml2 Chuck Lever
2018-10-31 20:02 ` Chuck Lever [this message]
2018-11-27 16:45   ` [PATCH v1 3/3] Finish port of junction support to nfs-utils Chuck Lever
2018-11-28 21:00     ` Steve Dickson
2018-11-28 21:05       ` Chuck Lever
2018-11-29 18:37         ` Steve Dickson
2018-11-29 18:46 ` [PATCH v1 1/3] Fix quoting in configure.ac Steve Dickson
2018-11-29 18:47   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181031200229.7507.26189.stgit@klimt.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.