Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp14552pxb; Thu, 27 Jan 2022 13:57:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzzPc3mYuGGYvnlh1AVFlpvI03MyLMcdrvXrifuFASTdNcflclDNzBBisA2sVhlOePck5T X-Received: by 2002:a05:6402:5110:: with SMTP id m16mr5465522edd.325.1643320671034; Thu, 27 Jan 2022 13:57:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643320671; cv=none; d=google.com; s=arc-20160816; b=djRUbG+hJrJfJbNyVuWC5JMhAiTqC8eEqnSkbi5nl9fBbgo9A8QVUMXBvmvg8Qs3ed zK5W+9gnzlKDs+HApCUHlCjUza64ycX1S1ZXGWuRrldRo4R+OrORc+EJKEF2KxQPAD96 jtjeDuxlcGcBIGHCiaVWAhnQ55n+Uw+wkFizC+ybhV+PkhZZXlDhgCbocQxIn24OQX5J C8EhUEuWo4z834a5lEuulXsAnxbML2eKFWIAQv/so79Jw3zWgXJNn2aK/Cc1CIjFXYg7 U1QfBA2uBOZEoGp4f1o+hEm+OtXhUYMWae/u80vq2LXIhzbIsZwJNT9vjIBgFmXPQKFS 3L6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-topic:thread-index :content-transfer-encoding:mime-version:subject:message-id:cc:to :from:date; bh=3KWrTA+OenDEBiVu5OitFerRrcJDxSe4LelQ/GRHTx4=; b=oKr/XLhlDrUKOIs+HnQi8mgV3B64UZQoE7I+EMPa6b2aHKVCwFAZZr6KfJjw5KCPkz OI/xeACfIf5T2AHp/PlAaRPVN4l2b0iuiNHB5QRB769+j8ECdfUbhuiYGH+W/+sbNQFp SxQSh/3q74EHzj2ys8HvFK/gbMIImLFmqap6VZbs/EOezXVM5InTszWw13Jtk/sXWBWl R6EoX/Bj6r+7I04RuHT+6RADFq3qeFspg1/QsfZA+koJiwvNogr/OSY31Gf1V5/gfJIO MCh5dIhdc2S8glZVzpWglqAVHpTlx6glmI+2MqPYoanRHKaPQilI8WHCVZDoQ0mpi9Mc YABQ== 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 gb41si2577035ejc.425.2022.01.27.13.57.14; Thu, 27 Jan 2022 13:57:50 -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 S241109AbiA0MWf (ORCPT + 99 others); Thu, 27 Jan 2022 07:22:35 -0500 Received: from lithops.sigma-star.at ([195.201.40.130]:44548 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241103AbiA0MWf (ORCPT ); Thu, 27 Jan 2022 07:22:35 -0500 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 8C54D60F6B67; Thu, 27 Jan 2022 13:22:32 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id IlR7MZ9cslD0; Thu, 27 Jan 2022 13:22:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id E133D60F6B7A; Thu, 27 Jan 2022 13:22:31 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9I09cn8jb155; Thu, 27 Jan 2022 13:22:31 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id BB08360F6B67; Thu, 27 Jan 2022 13:22:31 +0100 (CET) Date: Thu, 27 Jan 2022 13:22:31 +0100 (CET) From: Richard Weinberger To: linux-nfs Cc: bfields@fieldses.org, chuck.lever@oracle.com, david , luis.turcitu@appsbroker.com, chris.chilvers@appsbroker.com, david.young@appsbroker.com Message-ID: <1986873600.300036.1643286151703.JavaMail.zimbra@nod.at> Subject: NFSD export parsing issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF96 (Linux)/8.8.12_GA_3809) Thread-Index: tZUv125qQuwu7HR24zRIctOgjnMuiA== Thread-Topic: NFSD export parsing issue Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi! while experimenting with various modifications in mountd to deal better with crossmounts I noticed a problem in fs/nfsd/export.c svc_export_parse(), it always ignores the uuid as provided by my mountd. If CONFIG_NFSD_V4 is not enabled, both fsloc_parse() and secinfo_parse() are a no-op. This causes the while loop to terminate prematurely because only the keywords "fsloc" or "secinfo" got consumed, their parameters are still in the buffer and will trigger the break. while ((len = qword_get(&mesg, buf, PAGE_SIZE)) > 0) { if (strcmp(buf, "fsloc") == 0) err = fsloc_parse(&mesg, buf, &exp.ex_fslocs); else if (strcmp(buf, "uuid") == 0) err = nfsd_uuid_parse(&mesg, buf, &exp.ex_uuid); else if (strcmp(buf, "secinfo") == 0) err = secinfo_parse(&mesg, buf, &exp); else /* quietly ignore unknown words and anything * following. Newer user-space can try to set * new values, then see what the result was. */ break; if (err) goto out4; } nfs-utils mountd always places fslock and secinfo before the uuid, no mather whether I use NFSv4 or v3. So I'm not sure where to address the problem. Should we fix mountd or change both fsloc_parse() and secinfo_parse() to consume all their data even in the !CONFIG_NFSD_V4 case? Thanks, //richard