Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4904133yba; Mon, 13 May 2019 01:39:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPTBhJl4+fLQ9ocNoYAMMoL/kgTTtMw4L67tr1DkyJHcNW1QZTnlWKaf/fObRIBYCxYQxR X-Received: by 2002:a62:f245:: with SMTP id y5mr31539434pfl.12.1557736748179; Mon, 13 May 2019 01:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557736748; cv=none; d=google.com; s=arc-20160816; b=Lx2gK8fsS7ZKSxhp2xyysD61r14gQ4raIEQ4c4sTB9nkWPXLNI4n52Jc3Z9DPwuzqi CVZEuzK2Z6q+yhgQme9q/2T1o5ijPwbvL9S6Oy1QBg3BX0Vgjx82s8aRPgug1+TmxPjH ZfRh646ta41ITomvuw8fqBX/7xr05MxOKt477rF8N5yCceFAgoZrzFSnmNKX3NNLuw+y E4RNwF2fiThnGqHKw66CF6Qy45E1tTXmKGVElFqb4v+nVih2pq5UGSrt3pkox/NRha5B 4qLs51RNbhe5r1G2qM7tHlCXx11cPNMRXKyrNF0mqe39HCNUeIKp2oZHLNVRu99MzbFu 0o8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cyUmQ8vy+sEg9HuevGZhWPLB6f+nrnWNCPVjqsLJ/sQ=; b=euSw6/bZfTHn+JjFsmb/ucle+ihbr6RjUBwWoKHmFU4zycCxE4k4X/t3miYFrN72Yj Ldj5L0ni+Qecy1EDaQX6NKDoM1G3INwf2p3ZxF5mrQVJnCYN8RLqHEqx2clTzSdv4tV2 W6ABmKJed87Pz5HERJ6hZsgXj8OR97EI7EKIP1LbYA7+FVizpCfq1uhhwxxlZwNCb6GU 9Anh3ELHJqRvjoHlYHbpiHF/T/Ld27L417h+aPrUaKt8zN/5ka5hNF/nGQ5chRTJKs1A EAPt9/L6g8yhJgI4G49z2Xcq7HQrX8+u7w6fEz+0i/f2PE8K71DsTDOrcK+tBUB4z3v5 Tw7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si7218712pgo.517.2019.05.13.01.38.43; Mon, 13 May 2019 01:39:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728046AbfEMIMo convert rfc822-to-8bit (ORCPT + 99 others); Mon, 13 May 2019 04:12:44 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:53577 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfEMIMo (ORCPT ); Mon, 13 May 2019 04:12:44 -0400 Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Mon, 13 May 2019 10:12:42 +0200 Received: from localhost (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Mon, 13 May 2019 09:12:26 +0100 Date: Mon, 13 May 2019 10:12:24 +0200 From: Jan Fajerski To: "J. Bruce Fields" Cc: Jeff Layton , steved@redhat.com, linux-nfs@vger.kernel.org Subject: Re: [PATCH] manpage: explain why showmount doesn't really work against a v4-only server Message-ID: <20190513081224.4giacxxvler3xvnt@jfsuselaptop> References: <20190510215445.1823-1-jlayton@kernel.org> <20190511135442.GA15721@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20190511135442.GA15721@fieldses.org> User-Agent: NeoMutt/20180716 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sat, May 11, 2019 at 09:54:42AM -0400, J. Bruce Fields wrote: >On Fri, May 10, 2019 at 05:54:45PM -0400, Jeff Layton wrote: >> From: Jeff Layton >> >> 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! > >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. > >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. > >diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c >index 394f5284a219..de9a6d38783a 100644 >--- a/utils/showmount/showmount.c >+++ b/utils/showmount/showmount.c >@@ -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; > -- Jan Fajerski Engineer Enterprise Storage SUSE Linux GmbH, GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah HRB 21284 (AG N?rnberg)