manpage: explain why showmount doesn't really work against a v4-only server
Subsystems (2)
Jeff Layton
maintainerPATCH 1/1 manpage: explain why showmount doesn't really work against a v4-only server
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
--- utils/showmount/showmount.man | 5 +++++ 1 file changed, 5 insertions(+)
utils/showmount/showmount.man +5 -0
@@ -56,5 +56,10 @@ Because .B showmount sorts and uniqs the output, it is impossible to determine from the output whether a client is mounting the same directory more than once. +.P +.B showmount +works by contacting the server's MNT service directly. NFSv4-only servers have +no need to advertise their exported root filehandles via this method, and may +not expose their MNT service to clients. .SH AUTHOR Rick Sladkey <[email protected]>
Signature · 1 line
2.21.0
Quoted 6 lines · Jeff Layton
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
Looks fine.
I wonder if it'd also be helpful for showmount to detect this case and say something. E.g. the following (not even compileable, but you get the idea).
We've also talked about trying to cobble together an export list by scanning the root filesystem over NFSv4, but that's likely to be complicated and wouldn't give all the same results without further protocol extensions anyway, so I think that idea's dead.
--b.
utils/showmount/showmount.c +17 -0
@@ -115,6 +115,22 @@ static CLIENT *nfs_get_mount_client(const char *hostname, rpcvers_t vers)exit (1 ); } +void warn_if_v4_only (char *hostname) +{ +struct sockaddr_in server_addr, client_addr; + +if (fill_ipv4_sockaddr (hostname, &serveraddr)) +return ; + server_addr.sin_port =htnos (NFS_PORT ); + client_addr.sin_family =0 ; + client_addr.sin_addr.s_addr =0 ; +clnt_ping (&server_addr,NFS_PROGRAM ,4 ,"tcp" , &client_addr); + +if (rpc.createerr ==RPC_SUCCESS ) +printf ("Server responding to NFSv4 but not MNT; try mounting " +"%s:/ instead of showmount" , hostname); +} +int main (int argc,char **argv) {char hostname_buf[MAXHOSTLEN ];
@@ -199,6 +215,7 @@ int main(int argc, char **argv)fprintf (stderr,"%s: unable to create RPC auth handle.\n" , program_name);clnt_destroy (mclient); +warn_if_v4_only (hostname);exit (1 ); } total_timeout.tv_sec =TOTAL_TIMEOUT ;
Quoted 7 lines · J. Bruce Fields
Quoted 6 lines · Jeff Layton
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
Looks good...thanks Jeff!
Quoted 6 lines
Looks fine.
I wonder if it'd also be helpful for showmount to detect this case and say something. E.g. the following (not even compileable, but you get the idea).
This would be ideal of course.
Quoted 44 lines
We've also talked about trying to cobble together an export list by scanning the root filesystem over NFSv4, but that's likely to be complicated and wouldn't give all the same results without further protocol extensions anyway, so I think that idea's dead.
--b.
utils/showmount/showmount.c +17
-0@@ -115,6 +115,22 @@ static CLIENT *nfs_get_mount_client(const char *hostname, rpcvers_t vers)exit (1 ); } +void warn_if_v4_only (char *hostname) +{ +struct sockaddr_in server_addr, client_addr; + +if (fill_ipv4_sockaddr (hostname, &serveraddr)) +return ; + server_addr.sin_port =htnos (NFS_PORT ); + client_addr.sin_family =0 ; + client_addr.sin_addr.s_addr =0 ; +clnt_ping (&server_addr,NFS_PROGRAM ,4 ,"tcp" , &client_addr); + +if (rpc.createerr ==RPC_SUCCESS ) +printf ("Server responding to NFSv4 but not MNT; try mounting " +"%s:/ instead of showmount" , hostname); +} +int main (int argc,char **argv) {char hostname_buf[MAXHOSTLEN ];@@ -199,6 +215,7 @@ int main(int argc, char **argv)fprintf (stderr,"%s: unable to create RPC auth handle.\n" , program_name);clnt_destroy (mclient); +warn_if_v4_only (hostname);exit (1 ); } total_timeout.tv_sec =TOTAL_TIMEOUT ;
Signature · 4 lines
Jan Fajerski Engineer Enterprise Storage SUSE Linux GmbH, GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
Jeff Layton
maintainerQuoted 10 lines · J. Bruce Fields
Quoted 6 lines · Jeff Layton
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
Looks fine.
Quoted 9 lines
I wonder if it'd also be helpful for showmount to detect this case and say something. E.g. the following (not even compileable, but you get the idea).
We've also talked about trying to cobble together an export list by scanning the root filesystem over NFSv4, but that's likely to be complicated and wouldn't give all the same results without further protocol extensions anyway, so I think that idea's dead.
Agreed.
Quoted 30 lines
--b.
utils/showmount/showmount.c +16
-0@@ -115,6 +115,22 @@ static CLIENT *nfs_get_mount_client(const char *hostname, rpcvers_t vers)exit (1 ); } +void warn_if_v4_only (char *hostname) +{ +struct sockaddr_in server_addr, client_addr; + +if (fill_ipv4_sockaddr (hostname, &serveraddr)) +return ; + server_addr.sin_port =htnos (NFS_PORT ); + client_addr.sin_family =0 ; + client_addr.sin_addr.s_addr =0 ; +clnt_ping (&server_addr,NFS_PROGRAM ,4 ,"tcp" , &client_addr); + +if (rpc.createerr ==RPC_SUCCESS ) +printf ("Server responding to NFSv4 but not MNT; try mounting " +"%s:/ instead of showmount" , hostname); +} +int main (int argc,char **argv) {char hostname_buf[MAXHOSTLEN ];
utils/showmount/showmount.c int main(int argc, char **argv) · line 221
Quoted 7 lines
utils/showmount/showmount.c +1
-0@@ -199,6 +215,7 @@ int main(int argc, char **argv)fprintf (stderr,"%s: unable to create RPC auth handle.\n" , program_name);clnt_destroy (mclient); +warn_if_v4_only (hostname);exit (1 ); } total_timeout.tv_sec =TOTAL_TIMEOUT ;
Yeah, that certainly wouldn't hurt. I'd suggest we add that in a separate patch though.
We will need to spell this out in the manpage either way. At least with ganesha, you can export some filesystems via v3 and others via v4 only, and the MNT service there will only report the v3 ones. In that case, you have a reachable service, but the v4-only filesystems will be missing from showmount's output.
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 2 lines · Jeff Layton
Yeah, that certainly wouldn't hurt. I'd suggest we add that in a separate patch though.
Agreed.
Quoted 5 lines
We will need to spell this out in the manpage either way. At least with ganesha, you can export some filesystems via v3 and others via v4 only, and the MNT service there will only report the v3 ones. In that case, you have a reachable service, but the v4-only filesystems will be missing from showmount's output.
That doesn't sound like a great idea to me, but maybe you have no choice if for some reason you want to allow simultaneous support for v3-only clients and for filesystems that require long filehandles? Ugh.
Anyway, this kind of warning doesn't have to catch every odd case.
--b.
Quoted 6 lines · Jeff Layton
Quoted 2 lines
Yeah, that certainly wouldn't hurt. I'd suggest we add that in a separate patch though.
Agreed.
Quoted 7 lines
Quoted 5 lines
We will need to spell this out in the manpage either way. At least with ganesha, you can export some filesystems via v3 and others via v4 only, and the MNT service there will only report the v3 ones. In that case, you have a reachable service, but the v4-only filesystems will be missing from showmount's output.
That doesn't sound like a great idea to me, but maybe you have no choice
if for
Quoted 1 line
some reason you want to allow simultaneous support for v3-only clients and
for
Quoted 3 lines
filesystems that require long filehandles? Ugh.
Anyway, this kind of warning doesn't have to catch every odd case.
Good conversation.
Another thing worth noting in the warning also is that some servers (Ganesha for sure) will not list exports to showmount that the client issuing the showmount doesn't have access to (and for NFSv4 they won't show up in the directory listing).
Obviously the warning can't be perfect, but at least highlighting that the issue of what exports are visible is complicated.
Frank
Bruce,
Quoted 14 lines · J. Bruce Fields
Quoted 6 lines · Jeff Layton
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
Looks fine.
I wonder if it'd also be helpful for showmount to detect this case and say something. E.g. the following (not even compileable, but you get the idea).
Quoted 6 lines
We've also talked about trying to cobble together an export list by scanning the root filesystem over NFSv4, but that's likely to be complicated and wouldn't give all the same results without further protocol extensions anyway, so I think that idea's dead.
--b.
I'm a bit confused... Does this patch go along with Jeff's manpage change?
steved.
Quoted 37 lines
utils/showmount/showmount.c +17
-0@@ -115,6 +115,22 @@ static CLIENT *nfs_get_mount_client(const char *hostname, rpcvers_t vers)exit (1 ); } +void warn_if_v4_only (char *hostname) +{ +struct sockaddr_in server_addr, client_addr; + +if (fill_ipv4_sockaddr (hostname, &serveraddr)) +return ; + server_addr.sin_port =htnos (NFS_PORT ); + client_addr.sin_family =0 ; + client_addr.sin_addr.s_addr =0 ; +clnt_ping (&server_addr,NFS_PROGRAM ,4 ,"tcp" , &client_addr); + +if (rpc.createerr ==RPC_SUCCESS ) +printf ("Server responding to NFSv4 but not MNT; try mounting " +"%s:/ instead of showmount" , hostname); +} +int main (int argc,char **argv) {char hostname_buf[MAXHOSTLEN ];@@ -199,6 +215,7 @@ int main(int argc, char **argv)fprintf (stderr,"%s: unable to create RPC auth handle.\n" , program_name);clnt_destroy (mclient); +warn_if_v4_only (hostname);exit (1 ); } total_timeout.tv_sec =TOTAL_TIMEOUT ;
Quoted 17 lines · Steve Dickson
Bruce,
Quoted 14 lines · J. Bruce Fields
Quoted 6 lines · Jeff Layton
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
Looks fine.
I wonder if it'd also be helpful for showmount to detect this case and say something. E.g. the following (not even compileable, but you get the idea).
Quoted 7 lines
Quoted 6 lines
We've also talked about trying to cobble together an export list by scanning the root filesystem over NFSv4, but that's likely to be complicated and wouldn't give all the same results without further protocol extensions anyway, so I think that idea's dead.
--b.
I'm a bit confused... Does this patch go along with Jeff's manpage change?
It's separate. And doesn't even compile. You can ignore it for now.
--b.
Quoted 39 lines
steved.
Quoted 37 lines
utils/showmount/showmount.c +17
-0@@ -115,6 +115,22 @@ static CLIENT *nfs_get_mount_client(const char *hostname, rpcvers_t vers)exit (1 ); } +void warn_if_v4_only (char *hostname) +{ +struct sockaddr_in server_addr, client_addr; + +if (fill_ipv4_sockaddr (hostname, &serveraddr)) +return ; + server_addr.sin_port =htnos (NFS_PORT ); + client_addr.sin_family =0 ; + client_addr.sin_addr.s_addr =0 ; +clnt_ping (&server_addr,NFS_PROGRAM ,4 ,"tcp" , &client_addr); + +if (rpc.createerr ==RPC_SUCCESS ) +printf ("Server responding to NFSv4 but not MNT; try mounting " +"%s:/ instead of showmount" , hostname); +} +int main (int argc,char **argv) {char hostname_buf[MAXHOSTLEN ];@@ -199,6 +215,7 @@ int main(int argc, char **argv)fprintf (stderr,"%s: unable to create RPC auth handle.\n" , program_name);clnt_destroy (mclient); +warn_if_v4_only (hostname);exit (1 ); } total_timeout.tv_sec =TOTAL_TIMEOUT ;
Quoted 9 lines · Jeff Layton
From: Jeff Layton <[email protected]>
I occasionally see people that expect valid info when running showmount against a server that may export some or all filesystems via NFSv4. Let's make it clear that it only works by talking to the remote MNT service, and that that may not be available from a v4-only server.
Cc Jan Fajerski <[email protected]>Signed-off-by Jeff Layton <[email protected]>
Committed...
steved.
Quoted 21 lines
--- utils/showmount/showmount.man | 5 +++++ 1 file changed, 5 insertions(+)utils/showmount/showmount.man +5
-1@@ -56,5 +56,10 @@ Because .B showmount sorts and uniqs the output, it is impossible to determine from the output whether a client is mounting the same directory more than once. +.P +.B showmount +works by contacting the server's MNT service directly. NFSv4-only servers have +no need to advertise their exported root filehandles via this method, and may +not expose their MNT service to clients. .SH AUTHOR Rick Sladkey <[email protected]> -- 2.21.0