Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1562002pxb; Mon, 8 Mar 2021 00:07:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAjptwViVX3UOfch1Jdudl+ipmIQm3gsPhJ1aI36laGwNQrCvc6UhJhO/MCFXL28JdG/WW X-Received: by 2002:a17:906:f10c:: with SMTP id gv12mr13944098ejb.53.1615190841527; Mon, 08 Mar 2021 00:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615190841; cv=none; d=google.com; s=arc-20160816; b=N03ifygyW5DOJdmS5xpyb5AxPIrIlwh/twMpfftBoqlbO9S0HRjG0ovoExwR2v4iAT orwVdLRlrB5Nl2lS9aorMqCrfuEag1a0EgiwzOQ9uuAjU2k/9qSh+4XnYDNwuSbAZsvt VGNAiWNvGQRbkuUH5/UtAuI4jQjSu4cOgro60YjAetIEwda09s4/BsqS85bP5GBxlb/s /BO2hKnJXIh10s/Fj+Dm6acLz8sL170QGWOlXJFGlCN+h32TFw948mxHesKkCiveISZl +ihQiGF60NjRqCfrMbIEParrshbVLCl95Fv5nFP43jeoi6jkf0LnpsUCQogtmX0iLsdF vJ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:to; bh=GOfmfz7gtps+krpgtLuLNhC9cTEuoHf3fNLKjICinNk=; b=G99DShhm1cXrLJe8dHMDDi9rWYmio3F6tx80xAMoJ8uRQ/e+SxezxSb4qs7XA8yZzJ myWDoNkdf8BEtQajGM4fP7XAuqdgXFBYJOxlySCqGVheiCFEGt50BIv/Sfnd+P1xDObs ljhsEvs7w5anyt6Us6WonFTZ5CdnF1jnTNuWZg2UX5/qU7d4c4AEwm3J4ESEpQqmbf1q V6yhYowUJhPILP6RvQt949XIOgjjP2GWov16R7u1KgFEjSTc/huJifXBuddk+5l+vO/i iM+GB0CbAsdZ6dd+Ly1D0xHxx3HWjVe5YJc2600FnoshXIi+4W1Qcn2g6ZAAz3Z/wXYG EGmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m24si7159370eda.304.2021.03.08.00.06.58; Mon, 08 Mar 2021 00:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231430AbhCGSap (ORCPT + 99 others); Sun, 7 Mar 2021 13:30:45 -0500 Received: from mx3.molgen.mpg.de ([141.14.17.11]:43459 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231464AbhCGSaZ (ORCPT ); Sun, 7 Mar 2021 13:30:25 -0500 Received: from [192.168.0.5] (ip5f5aea7c.dynamic.kabel-deutschland.de [95.90.234.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: buczek) by mx.molgen.mpg.de (Postfix) with ESMTPSA id D7FAF206446A2; Sun, 7 Mar 2021 19:30:16 +0100 (CET) To: Trond Myklebust , Linux NFS Mailing List From: Donald Buczek Subject: [BUG] nfs-utils: mountd doesn't work with elder glibc versions Message-ID: Date: Sun, 7 Mar 2021 19:30:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi, we noticed that our exports don't work with nfs-utils 2.5.3. The reason is, that 76c21e3f ("mountd: Check the stat() return values in match_fsid()") added a new error handling. It sets errno to 0 and assumes that it is stable when there are no errors. However, this conflicts with the logic in support/misc/xstat.c, which sets errno to ENOSYS if glibc doesn't support statx() or has an incomplete emulation. We have glibc 2.27 which doesn't support statx(). root@dose:~# findmnt /amd/dose/0 TARGET SOURCE FSTYPE OPTIONS /amd/dose/0 /dev/vda2 xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota root@dose:~# /usr/sbin/rpc.mountd --foreground --manage-gids -d all & [1] 26777 root@dose:~# rpc.mountd: Version 2.5.3 starting root@dose:~# exportfs dose:/amd/dose/0 root@dose:~# mount dose:/amd/dose/0 /mnt rpc.mountd: auth_unix_ip: inbuf 'nfsd 141.14.17.51' rpc.mountd: auth_unix_ip: inbuf 'nfsd 141.14.17.51' rpc.mountd: auth_unix_ip: client 0x459850 'dose.molgen.mpg.de' rpc.mountd: v4root_create: path '/' flags 0x12403 rpc.mountd: auth_unix_ip: inbuf 'nfsd 141.14.17.51' rpc.mountd: auth_unix_ip: client 0x459850 'dose.molgen.mpg.de' rpc.mountd: v4root_create: path '/amd' flags 0x10403 rpc.mountd: v4root_create: path '/amd/dose' flags 0x10403 rpc.mountd: auth_unix_ip: client 0x451010 'dose.molgen.mpg.de' rpc.mountd: rpc.mountd: nfsd_fh: inbuf 'dose.molgen.mpg.de 1 \x00000000'nfsd_fh: inbuf 'dose.molgen.mpg.de 1 \x00000000' rpc.mountd: nfsd_fh: found 0x45b1c0 path / rpc.mountd: nfsd_fh: found 0x45c070 path / rpc.mountd: nfsd_export: inbuf 'dose.molgen.mpg.de /amd'rpc.mountd: nfsd_export: inbuf 'dose.molgen.mpg.de /amd' rpc.mountd: nfsd_export: found 0x442eb0 path /amdrpc.mountd: nfsd_export: found 0x45b6d0 path /amd rpc.mountd: rpc.mountd: nfsd_fh: inbuf 'dose.molgen.mpg.de 7 \x83000000000000005e2eaee859174457bcd564e9512178dc'nfsd_fh: inbuf 'dose.molgen.mpg.de 7 \x83000000000000005e2eaee859174457bcd564e9512178dc' rpc.mountd: nfsd_fh: found 0x442ec0 path /amdrpc.mountd: nfsd_fh: found 0x45b6e0 path /amd rpc.mountd: nfsd_export: inbuf 'dose.molgen.mpg.de /amd/dose' rpc.mountd: nfsd_export: inbuf 'dose.molgen.mpg.de /amd/dose' rpc.mountd: rpc.mountd: nfsd_export: found 0x4433d0 path /amd/dosenfsd_export: found 0x45bbf0 path /amd/dose rpc.mountd: nfsd_fh: inbuf 'dose.molgen.mpg.de 7 \x81000820000000005e2eaee859174457bcd564e9512178dc'rpc.mountd: nfsd_fh: inbuf 'dose.molgen.mpg.de 7 \x81000820000000005e2eaee859174457bcd564e9512178dc' rpc.mountd: nfsd_fh: found 0x4433e0 path /amd/dose rpc.mountd: nfsd_fh: found 0x45bc00 path /amd/dose rpc.mountd: nfsd_export: inbuf 'dose.molgen.mpg.de /amd/dose/0' rpc.mountd: nfsd_export: inbuf 'dose.molgen.mpg.de /amd/dose/0' rpc.mountd: nfsd_export: found 0x443550 path /amd/dose/0 rpc.mountd: nfsd_fh: inbuf 'dose.molgen.mpg.de 6 \xa7287020bece44b09df5b577a4b82823' rpc.mountd: nfsd_export: found 0x45bb40 path /amd/dose/0 rpc.mountd: nfsd_fh: found (nil) path (null)rpc.mountd: nfsd_fh: inbuf 'dose.molgen.mpg.de 6 \xa7287020bece44b09df5b577a4b82823' rpc.mountd: nfsd_fh: found (nil) path (null) ( mount hangs until interrupted ) With the following workaround, things works again: diff --git a/support/export/cache.c b/support/export/cache.c index f1569afb..1b671c32 100644 --- a/support/export/cache.c +++ b/support/export/cache.c @@ -722,7 +722,7 @@ match: path_error: if (path_lookup_error(errno)) goto nomatch; - return -1; + return 0; } static struct addrinfo *lookup_client_addr(char *dom) Another minor one, I noticed when searching for the above: diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c index 14d6731d..ae664d6a 100644 --- a/support/misc/mountpoint.c +++ b/support/misc/mountpoint.c @@ -37,7 +37,7 @@ check_is_mountpoint(const char *path, int (mystat)(const char *, struct stat *)) rv = 0; else if (stb.st_dev != pstb.st_dev || - stb.st_ino == pstb.st_ino) + stb.st_ino != pstb.st_ino) rv = 1; else rv = 0; I just assume, this would be right and might be relevant to exported bind mounts. But I didn't try to trigger the assumed bug here. Best Donald