Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6336073ybi; Wed, 29 May 2019 06:27:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8D2kmjc3Y2MX/oTU6Tqr3MoGN9snZRFPIL99y2Uujlm/LuoVpvdP/KXCtknWsi+rXylBF X-Received: by 2002:a62:e303:: with SMTP id g3mr147893032pfh.220.1559136426978; Wed, 29 May 2019 06:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559136426; cv=none; d=google.com; s=arc-20160816; b=lF3bRQk9j5XPFK3miGsJRl6EV3rD4oX0bZ9aL6IlgXVXqStiFgvBgiJTYzV+3O0hwN 4RthUUrAsLUmgFDjFkjC0adPK7ZCwSjz9PabT/U8whRZJxZeA79n2zRgkrU0TeWhzkvz 8pl6EFt01G+8a6cV0f1V5HdOHrRrQYzA7yIvTHe6+tYZ2sFrLaqTOmkSnFIPfVHqoITe z6BeA17qlRSfHnPLM+hNUD3XAeB7NXahD2Hilu1BKhKo9XJZpqwoS3L2+fiFDKqR7lpQ rzGkqZBM3DknUgUz5wXXqLdOaUevmDiOIYx6mhY2SBs3L7dqXV6+YqLAUrVjE8OhTTEu Z+Sg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JPVafPTRC2GkW/iBM5yr3hksY/XzjtSqi2jyQ1UISCc=; b=g/WMJaJrBSvbtblM1mqTIF4rcg5ku0euIfBkiXReonD4zWbcfXIY2eaZzuKL08326u aJBbaolTiDEJ2LM1fqh5l6n5s/fe2EA7pSw2xrM2+zWdiq7K9SQIT/xpbnK7QR271tsr hAYGmozWsn0qXdUG/YBxYTHSezI9/tnw+5sqgsvkQI59i/VVIPjOD2eMcRHsurGrHIvS pIKlewq6qylCcOGHrUYUmW6KWHr1UFBCfdTqRByyxOAxdp+4DUstSbzq21i2HziVLcMi YJ0czdD34+ZIGyI12D+sKspnF87o9sIA+fHcnt7OXy0TH7BR2ANUFrKsD8+yDug0Dorj zlAw== 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 s24si23919417pga.515.2019.05.29.06.26.46; Wed, 29 May 2019 06:27:06 -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 S1726702AbfE2NYm (ORCPT + 99 others); Wed, 29 May 2019 09:24:42 -0400 Received: from fieldses.org ([173.255.197.46]:39642 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfE2NYm (ORCPT ); Wed, 29 May 2019 09:24:42 -0400 Received: by fieldses.org (Postfix, from userid 2815) id B0B311E3A; Wed, 29 May 2019 09:24:41 -0400 (EDT) Date: Wed, 29 May 2019 09:24:41 -0400 From: "J. Bruce Fields" To: Steve Dickson Cc: Jeff Layton , linux-nfs@vger.kernel.org, jfajerski@suse.com Subject: Re: [PATCH] manpage: explain why showmount doesn't really work against a v4-only server Message-ID: <20190529132441.GA8235@fieldses.org> References: <20190510215445.1823-1-jlayton@kernel.org> <20190511135442.GA15721@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, May 29, 2019 at 09:15:35AM -0400, Steve Dickson wrote: > Bruce, > > On 5/11/19 9:54 AM, 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 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. > 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. > > steved. > > > > 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; > >