* [PATCH 0/2] Two more nfs-utils patches
@ 2009-05-18 16:12 Chuck Lever
[not found] ` <20090518161224.12029.86761.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2009-05-18 16:12 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Steve-
While you're at it, here are two more fixes.
---
Chuck Lever (2):
umount.nfs: Harden umount.nfs error reporting
nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c
support/nfs/rpc_socket.c | 12 +++++-------
utils/mount/network.c | 19 ++++++++++++++-----
utils/mount/nfsumount.c | 17 +++++++++--------
3 files changed, 28 insertions(+), 20 deletions(-)
--
Chuck Lever <chuck.lever@oracle.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c
[not found] ` <20090518161224.12029.86761.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
@ 2009-05-18 16:13 ` Chuck Lever
2009-05-18 16:13 ` [PATCH 2/2] umount.nfs: Harden umount.nfs error reporting Chuck Lever
2009-05-18 17:27 ` [PATCH 0/2] Two more nfs-utils patches Steve Dickson
2 siblings, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2009-05-18 16:13 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Use the correct #ifdef variable to enable IPv6 support for privileged
RPC clients. Without this fix, unmounting an IPv6 NFSv2/v3 server
fails.
Introduced by commit 8c94296bc84f3a204f2061c0391a1d2350e4f37e.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
support/nfs/rpc_socket.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/support/nfs/rpc_socket.c b/support/nfs/rpc_socket.c
index 85e6064..cebf83d 100644
--- a/support/nfs/rpc_socket.c
+++ b/support/nfs/rpc_socket.c
@@ -132,7 +132,7 @@ static int nfs_bind(const int sock, const sa_family_t family)
return -1;
}
-#ifdef IPV6_SUPPORT
+#ifdef IPV6_SUPPORTED
/*
* Bind a socket using an unused privileged source port.
@@ -153,18 +153,16 @@ static int nfs_bindresvport(const int sock, const sa_family_t family)
switch (family) {
case AF_INET:
- return bindresvport_sa(sock, (struct sockaddr *)&sin,
- (socklen_t)sizeof(sin));
+ return bindresvport_sa(sock, (struct sockaddr *)&sin);
case AF_INET6:
- return bindresvport_sa(sock, (struct sockaddr *)&sin6,
- (socklen_t)sizeof(sin6));
+ return bindresvport_sa(sock, (struct sockaddr *)&sin6);
}
errno = EAFNOSUPPORT;
return -1;
}
-#else /* !IPV6_SUPPORT */
+#else /* !IPV6_SUPPORTED */
/*
* Bind a socket using an unused privileged source port.
@@ -182,7 +180,7 @@ static int nfs_bindresvport(const int sock, const sa_family_t family)
return bindresvport(sock, NULL);
}
-#endif /* !IPV6_SUPPORT */
+#endif /* !IPV6_SUPPORTED */
/*
* Perform a non-blocking connect on the socket fd.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] umount.nfs: Harden umount.nfs error reporting
[not found] ` <20090518161224.12029.86761.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-05-18 16:13 ` [PATCH 1/2] nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c Chuck Lever
@ 2009-05-18 16:13 ` Chuck Lever
2009-05-18 17:27 ` [PATCH 0/2] Two more nfs-utils patches Steve Dickson
2 siblings, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2009-05-18 16:13 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
Add additional error reporting to nfs_advise_umount(). These messages can
be displayed if the "-v" option is specified with umount.nfs. Normally
these messages do not appear.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
utils/mount/network.c | 19 ++++++++++++++-----
utils/mount/nfsumount.c | 17 +++++++++--------
2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/utils/mount/network.c b/utils/mount/network.c
index d93e98d..04a62ab 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -819,17 +819,24 @@ int nfs_advise_umount(const struct sockaddr *sap, const socklen_t salen,
CLIENT *client;
enum clnt_stat res = 0;
- if (nfs_probe_mntport(sap, salen, &mnt_pmap) == 0)
- return 0;
-
memcpy(saddr, sap, salen);
+ if (nfs_probe_mntport(saddr, salen, &mnt_pmap) == 0) {
+ if (verbose)
+ nfs_error(_("%s: Failed to discover mountd port%s"),
+ progname, clnt_spcreateerror(""));
+ return 0;
+ }
nfs_set_port(saddr, mnt_pmap.pm_port);
client = nfs_get_priv_rpcclient(saddr, salen, mnt_pmap.pm_prot,
mnt_pmap.pm_prog, mnt_pmap.pm_vers,
&timeout);
- if (client == NULL)
+ if (client == NULL) {
+ if (verbose)
+ nfs_error(_("%s: Failed to create RPC client%s"),
+ progname, clnt_spcreateerror(""));
return 0;
+ }
client->cl_auth = authunix_create_default();
@@ -837,13 +844,15 @@ int nfs_advise_umount(const struct sockaddr *sap, const socklen_t salen,
(xdrproc_t)xdr_dirpath, (caddr_t)argp,
(xdrproc_t)xdr_void, NULL,
timeout);
+ if (verbose && res != RPC_SUCCESS)
+ nfs_error(_("%s: UMNT call failed: %s"),
+ progname, clnt_sperrno(res));
auth_destroy(client->cl_auth);
CLNT_DESTROY(client);
if (res != RPC_SUCCESS)
return 0;
-
return 1;
}
diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c
index 4b2e530..9b48cc9 100644
--- a/utils/mount/nfsumount.c
+++ b/utils/mount/nfsumount.c
@@ -182,14 +182,15 @@ static int nfs_umount_do_umnt(struct mount_options *options,
return EX_FAIL;
}
- if (nfs_name_to_address(*hostname, sap, &salen)) {
- if (nfs_advise_umount(sap, salen, &mnt_pmap, dirname) != 0)
- return EX_SUCCESS;
- else
- nfs_error(_("%s: Server failed to unmount '%s:%s'"),
- progname, *hostname, *dirname);
- }
- return EX_FAIL;
+ if (nfs_name_to_address(*hostname, sap, &salen) == 0)
+ /* nfs_name_to_address reports any errors */
+ return EX_FAIL;
+
+ if (nfs_advise_umount(sap, salen, &mnt_pmap, dirname) == 0)
+ /* nfs_advise_umount reports any errors */
+ return EX_FAIL;
+
+ return EX_SUCCESS;
}
/*
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Two more nfs-utils patches
[not found] ` <20090518161224.12029.86761.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-05-18 16:13 ` [PATCH 1/2] nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c Chuck Lever
2009-05-18 16:13 ` [PATCH 2/2] umount.nfs: Harden umount.nfs error reporting Chuck Lever
@ 2009-05-18 17:27 ` Steve Dickson
2 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2009-05-18 17:27 UTC (permalink / raw)
To: Chuck Lever; +Cc: linux-nfs
Chuck Lever wrote:
> Steve-
>
> While you're at it, here are two more fixes.
>
> ---
>
> Chuck Lever (2):
> umount.nfs: Harden umount.nfs error reporting
> nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c
>
>
> support/nfs/rpc_socket.c | 12 +++++-------
> utils/mount/network.c | 19 ++++++++++++++-----
> utils/mount/nfsumount.c | 17 +++++++++--------
> 3 files changed, 28 insertions(+), 20 deletions(-)
>
Committed...
steved.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-18 17:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18 16:12 [PATCH 0/2] Two more nfs-utils patches Chuck Lever
[not found] ` <20090518161224.12029.86761.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2009-05-18 16:13 ` [PATCH 1/2] nfs-utils: Fix IPv6 support in support/nfs/rpc_socket.c Chuck Lever
2009-05-18 16:13 ` [PATCH 2/2] umount.nfs: Harden umount.nfs error reporting Chuck Lever
2009-05-18 17:27 ` [PATCH 0/2] Two more nfs-utils patches Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox