Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6322159ybi; Wed, 29 May 2019 06:16:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDg+itdEOZbXwe5tLvEVEANylHLXh6Yzb60zfmebKaGtPoU3IATNgaQaQjwlcQ3w3zxO3v X-Received: by 2002:a63:fa16:: with SMTP id y22mr99193731pgh.15.1559135778435; Wed, 29 May 2019 06:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559135778; cv=none; d=google.com; s=arc-20160816; b=KPPlI7HicV/kOQAOym6DP72uPTZzNSGGUu6H5r9xkiGkS7IPG4GuvuiZbRzmFQDAHz B+eiQ8TbF0HEfWSMppr+ikCsDOuIzV8IVLKEEl/0XK9bULxQ8q8oABrWSMCxS80yOFMF FHph+NmKYbvLqJsgkGpiKMlUG6m+rBqk/oqUFAJpm1IdeuLEI7wtH+cf/BbNtVPzz91B zbNSJQlOUNVtp8/nxlQPQ2l37EYHpXs5lOg9ShOgGoP2ieRhS172/pFHVyJsRIV4gHtp 24Lo7g2IuW4AB30qJtIxWUoJs3jfqB3OInTCmx5DBSrCukg2aeH0vARtqIv+ZdQqutzW s8LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MavLWuiJoHfEjFfC8TXqAlUjxaiMcu0A/mvwzjKrXZg=; b=iChGCSxXfw96AX4ssZXYpqFznhnfoSD3TC2xRAuZkQaZZ6/XAI4R7Tq0fd1/wsxNua LOmNrcHQEH1+wGtkeGTbJhQ+0CXQN7Algo/N5b2QOTuTR2gD4zHc4lYT5ax4yGsOwL5W LC//cT89z7GLpBbbzMOaUkD5Jzfv5oRi7FSYZtwUQJSjM+rQL0QHGBKIqMbsUS7ICTPi E6f46Wk2AoYHP5/sP+OC2r0ereZE+zb00eiUaQmU57l7Uog83fQTe9xI0u73wTCWX06l uyBdxvQFlgV6nuFqFuKx6bWET7nKVrrKWuWXcLvU8ITEroPrlbNMs7MQaUc5+0FBY/Q0 IC1A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a69si26633758pla.178.2019.05.29.06.15.59; Wed, 29 May 2019 06:16:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbfE2NPm (ORCPT + 99 others); Wed, 29 May 2019 09:15:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41532 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfE2NPm (ORCPT ); Wed, 29 May 2019 09:15:42 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCB963179164; Wed, 29 May 2019 13:15:36 +0000 (UTC) Received: from madhat.boston.devel.redhat.com (ovpn-117-143.phx2.redhat.com [10.3.117.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA0611972C; Wed, 29 May 2019 13:15:35 +0000 (UTC) Subject: Re: [PATCH] manpage: explain why showmount doesn't really work against a v4-only server To: "J. Bruce Fields" , Jeff Layton Cc: linux-nfs@vger.kernel.org, jfajerski@suse.com References: <20190510215445.1823-1-jlayton@kernel.org> <20190511135442.GA15721@fieldses.org> From: Steve Dickson Message-ID: Date: Wed, 29 May 2019 09:15:35 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190511135442.GA15721@fieldses.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 29 May 2019 13:15:42 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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? 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; >