Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1222820rwd; Wed, 7 Jun 2023 12:59:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mUuqL3vMeMf8NowD5pQsrkBUUgSTkZselBiSol2BkqXwdcY5n1/Dkd0twrASmwp8t1G1E X-Received: by 2002:a17:902:cec4:b0:1b1:dfbd:a192 with SMTP id d4-20020a170902cec400b001b1dfbda192mr3393089plg.57.1686167958564; Wed, 07 Jun 2023 12:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686167958; cv=none; d=google.com; s=arc-20160816; b=ktMbDTDR5PMlaIc5MeW0mnzoMef4np9JsV/WslE9RP62hzm/Pb5YKurIp8qXqrFRD1 4xQOzMLrQKW4TUgCUITkxyJIn544jFO9QyXB7ZnCInAa14fTrhwa+EayjuW+1XK258jp Bu+06et7BWr4MPdacudaQvDGIWRy26DZVZSLb33lHhheDbYGWhQK7g77huU5kJH8WOeb mguYD/ir0IeSloAZZCt83s9lYmWuLtMZOVcyWmueGARUYKA33w/co6BRnh5+/Z0BbxC6 1RfQeYhiKnGLZg8vqJpovJ423uqYOtGCGhdtR0GOmJVU8TvKOUaj/XZN1EQnySIzw9m7 U1rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=cOScwgcUlXYSdodgyRtfjBmxVIzM91MCOaGJU+6GTew=; b=Dtuqtejcas8hLDAzNstVpl38h02PXDj4D6nxhp3gANSwClt55x1XnJ7suS8m3Sp6Tf bN8A1FpT7UiOPojn1xMOY4dCy1WjVTYXRsRscOnXBFQbzbVNuDCTz+wJIa8fDn2cWY7k G/MOxtF0NoWa+j7Pnu6rBGi1oJ3HDKC7Hc4ZKNBd/Yf7J0GDHK3Fr2+JbqHsosvfxuP3 GWXHFGwLzeYN7pxsR2SZrURCZ/mhm3s15NU9F7VS2OC8qNrUrQq3WfoWG1HCpVWMfjHs WHjaVeYXy0sJoKoEqeYLp/Y7sOtjLMIAgQWm7xQ/MjfgTCmWjo9L7GUDql3yPB5NElMs ItlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=L1XqR3Dy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o2-20020a170902d4c200b0019955f0dc48si777728plg.527.2023.06.07.12.58.53; Wed, 07 Jun 2023 12:59:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@t-8ch.de header.s=mail header.b=L1XqR3Dy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbjFGTom (ORCPT + 99 others); Wed, 7 Jun 2023 15:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjFGTol (ORCPT ); Wed, 7 Jun 2023 15:44:41 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE36C1FE0; Wed, 7 Jun 2023 12:44:39 -0700 (PDT) Date: Wed, 7 Jun 2023 21:44:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1686167076; bh=DHQuMlD6tuImvscO3wkh4mwa16D27WZo2cWB+OFKZfk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L1XqR3DytaNGIKKsOZQJRNxbUQYt9DIOlmIft3RqxBCPH5rwk4xKu39CNTZNM6G82 AludZr5yuij/sjLthOcA1tAnwMyRaeX8chijmaNKdVkhDy8cnyFuI5bS/ksdJqjaVv /+NqyPpaOatDI68pY+Hj/5dRvI4RveUEKmtUPDKU= From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Christian Brauner Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells , Karel Zak , stable@vger.kernel.org Subject: Re: [PATCH] fs: avoid empty option when generating legacy mount string Message-ID: References: <20230607-fs-empty-option-v1-1-20c8dbf4671b@weissschuh.net> <20230607-rennpferd-stechen-2f645ac78fcc@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230607-rennpferd-stechen-2f645ac78fcc@brauner> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-06-07 21:39:01+0200, Christian Brauner wrote: > On Wed, Jun 07, 2023 at 07:28:48PM +0200, Thomas Weißschuh wrote: > > As each option string fragment is always prepended with a comma it would > > happen that the whole string always starts with a comma. > > This could be interpreted by filesystem drivers as an empty option and > > may produce errors. > > > > For example the NTFS driver from ntfs.ko behaves like this and fails when > > mounted via the new API. > > > > Link: https://github.com/util-linux/util-linux/issues/2298 > > Yeah, the old ntfs driver implements its own option parser. It > overwrites/splits at ',' returning '\0' and then trips over this. > > Contrast with e.g., ovl_next_op() which does the same thing but skips > over '\0' in ovl_parse_opt(). > > So arguably also a bug in ntfs parsing. But there's no reason we should > prepend ',' for legacy mount option strings. > > And yeah, I can easily verify this... > > Using my custom move-mount tool I originally wrote for another patchset > but which is handy to pass mount options via the new mount api _system_ > calls and not via mount(): > https://github.com/brauner/move-mount-beneath > > I can do: > > sudo ./move-mount -f overlay -olowerdir=/mnt/a:/mnt/b,upperdir=/mnt/upper,workdir=/mnt/work /mnt/merged > > and clearly see: > > > sudo bpftrace -e 'kfunc:legacy_get_tree { @m = args->fc; printf("%s\n", str(((struct legacy_fs_context *)@m->fs_private)->legacy_data)); }' > Attaching 1 probe... > ,lowerdir=/mnt/a:/mnt/b,upperdir=/mnt/upper,workdir=/mnt/work > > > Fixes: 3e1aeb00e6d1 ("vfs: Implement a filesystem superblock creation/configuration context") > > Should be: > > Fixes: commit 3e1aeb00e6d1 ("vfs: Implement a filesystem superblock creation/configuration context") AFAIK the Fixes: tag does not use the "commit" keyword. Only inline commit references. This is how it's currently documented in Documentation/process/submitting-patches.rst. > and misses a: > > Cc: stable@vger.kernel.org This was fixed in v2. > I'll fix this up for you though. Thanks! Thomas