Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp592102ybl; Fri, 13 Dec 2019 01:16:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxEjo9fgSvAJyTALEY7Lg88H8wqKMKhcI0xeUFXnaCZQp4ZbWd62rX5VXsVD053247j0+Am X-Received: by 2002:a9d:68ca:: with SMTP id i10mr13226167oto.178.1576228584080; Fri, 13 Dec 2019 01:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576228584; cv=none; d=google.com; s=arc-20160816; b=y6JhWQ0nVlzpowt5tZsxxjtPM8NUyXZeos6jJ+62Cm4qkuAW0uPsVyfQgYM7SfLOJs KB8cgSwqUYsm0J2pal1PTr/G+O1Vivg8hgpxCV+6FhrngmE8SkKwWCuy8IZ7vsDVB21y dxQr19Gky1IHJB/qNQflLLBnjbi8q1A3f620MzUze7bXHH4z5TK/6b5JW76mX+vlqTLN bQOG3y/AuDKnBmr0jaYcFis9RZ5aIZEciv2kiPH/j7so+JYWZiNkTqu1c3WVRD+O2TsW VG0yyKjsxTmh2ErDa2BnaTyqvF/8/VtK9byYRQqKGsalfO5nL4EHuiBHpTSEd04CWjkR VLfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lhhQ4tcwmeQStYaNHbNoHSE/s07Lkdx+vy7ZqDxz9/I=; b=UZsveZ6Iv+6jJW4HqwrzKdAQs3+BPtKQ5fHWIauOz2QS/DaEFE2SJTeawy+ChxTj9C 9QHdDcQ1z23AYrNQSEupUdpCxfALM2ewCTm6lEvqcYpFakrY/uy6546TxzOf8+8/Hh0O zBB4nZZ4QmXOLHmLrPd2x7i9s7XH/AZYMmN3E5WE56iP7HFC05eoFoyqRny3OMi24gvk eS7lZCSruoyzEI6gb3D0AUIWgKQ5EZGShSxPiQs38VuGfRNwUco+bCaUbZnif8+F32xT DrT2BoQbkNBLMKozbph12g+auQo90/diF0f73j67jKhiITnjEukh+Z+IVDt/rUWtkCGN ITDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=bqf2gMqM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f187si4878566oia.218.2019.12.13.01.16.11; Fri, 13 Dec 2019 01:16:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=bqf2gMqM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726345AbfLMJPP (ORCPT + 99 others); Fri, 13 Dec 2019 04:15:15 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:40024 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbfLMJPP (ORCPT ); Fri, 13 Dec 2019 04:15:15 -0500 Received: by mail-il1-f194.google.com with SMTP id b15so1490036ila.7 for ; Fri, 13 Dec 2019 01:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lhhQ4tcwmeQStYaNHbNoHSE/s07Lkdx+vy7ZqDxz9/I=; b=bqf2gMqMPcj2CdLdx4/7z4SGPeOe16t3NFwPGyEqAuIo3bArzFCAnXojgo9vOKILnZ X2SbwaIsIiPqYIwIin/JpANpYMRTtnqS8wQpGLp6fm5GFyV21XYAouJ3KIFZDZIJAPCK 5Z5iqD+pbjGRfNLbDhwMl2nHCWEw66RArAP2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lhhQ4tcwmeQStYaNHbNoHSE/s07Lkdx+vy7ZqDxz9/I=; b=EvKAlPuZyE4Tp1B/RHSwJnoH0Pv0w0D1xDEm9Bro9nlNT9VUPUL+SbD1GghChZ4LkC ifs47EcvJjkWnPCxshsb8XG84iMxvsdgBTRLxxNS6pgtEgzeLKtj1XcaSTNdzV15fx7I /i+MxQKvtMaioZmgItkdSCBEFh/OtCoFvc95zq1SpeojykVqAeJFkpJ08kgA9WOn/ewA GzcCsyMrTpUPkd/QYHoLjC4JWPIP+gTv/KpbnewHGQAHcekhOzxjPka3DL5Gro5sLzTK 4dXvW39zDP7mwtnAEbb+rpN1OhLcT+VyrWvioyALdROxI5+u/sUJKVKuuUQSpxXyvDsK XHtA== X-Gm-Message-State: APjAAAVJDiq5pmn7FcdvH/eGx/NuGbkHm/bfPdXqsGhct+iG51nvb8/e P/K/IKEg/xZllULlCPd47qcxyI7GRjcsdM3MGxP3QA== X-Received: by 2002:a92:89c2:: with SMTP id w63mr12345010ilk.252.1576228514214; Fri, 13 Dec 2019 01:15:14 -0800 (PST) MIME-Version: 1.0 References: <20191212145042.12694-1-labbott@redhat.com> <20191212213609.GK4203@ZenIV.linux.org.uk> In-Reply-To: <20191212213609.GK4203@ZenIV.linux.org.uk> From: Miklos Szeredi Date: Fri, 13 Dec 2019 10:15:03 +0100 Message-ID: Subject: Re: [PATCH] vfs: Don't reject unknown parameters To: Al Viro Cc: Laura Abbott , Linus Torvalds , Ilya Dryomov , David Howells , Jeremi Piotrowski , Linux FS Devel , Phillip Lougher , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 12, 2019 at 10:36 PM Al Viro wrote: > So you could bloody well just leave recognition (and handling) of "source" > to the caller, leaving you with just this: > > if (strcmp(param->key, "source") == 0) > return -ENOPARAM; > /* Just log an error for backwards compatibility */ > errorf(fc, "%s: Unknown parameter '%s'", fc->fs_type->name, param->key); > return 0; Which is fine for the old mount(2) interface. But we have a brand new API as well; do we really need to carry these backward compatibility issues forward? I mean checking if a param/flag is supported or not *is* useful and lacking that check is the source of numerous headaches in legacy interfaces (just take the open(2) example and the introduction of O_TMPFILE). Just need a flag in fc indicating if this option comes from the old interface: if (strcmp(param->key, "source") == 0) return -ENOPARAM; /* Just log an error for backwards compatibility */ errorf(fc, "%s: Unknown parameter '%s'", fc->fs_type->name, param->key); return fc->legacy ? 0 : -ENOPARAM; And TBH, I think that logic applies to the common flags as well. Some of these simply make no sense on the new interface ("silent", "posixacl") and some are ignored for lots of filesystems ("sync", "dirsync", "mand", "lazytime"). It would also be nice to reject "rw" for read-only filesystems. I have sent patches for the above numerous times, all been ignored by DavidH and Al. While this seems minor now, I think getting this interface into a better shape as early as possible may save lots more headaches later... Thanks, Miklos