From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36CF8C43603 for ; Tue, 17 Dec 2019 17:49:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3AF1206D8 for ; Tue, 17 Dec 2019 17:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZTil9rVh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727709AbfLQRtQ (ORCPT ); Tue, 17 Dec 2019 12:49:16 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:26781 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726836AbfLQRtQ (ORCPT ); Tue, 17 Dec 2019 12:49:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576604955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wO1qMflxlmElp6VWAUkeNwtiS3C7c/h9/cKUd83moYw=; b=ZTil9rVhI/bmZUgqD3uK7Ib+obgH2KVotzl0umeyW/HnWFzhhSUUOHuI6KzA9onqrZ5br8 0MX0fe3d9ZbP+K30cWSHGnNLXq/dlBsaCz8jfsYe3N4D3FzugDkbc3UenRRqyiaMBV/+zd o+YrxRCHhT1XZ8iaqzHW+KfKy9onAto= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-S3v4bJ6rObCwVamgrwtXhQ-1; Tue, 17 Dec 2019 12:49:11 -0500 X-MC-Unique: S3v4bJ6rObCwVamgrwtXhQ-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FB79DC11; Tue, 17 Dec 2019 17:49:10 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-52.rdu2.redhat.com [10.10.120.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2453F2656B; Tue, 17 Dec 2019 17:49:07 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20191212145042.12694-1-labbott@redhat.com> <20191212213609.GK4203@ZenIV.linux.org.uk> To: Miklos Szeredi Cc: dhowells@redhat.com, Al Viro , Laura Abbott , Linus Torvalds , Ilya Dryomov , Jeremi Piotrowski , Linux FS Devel , Phillip Lougher , LKML Subject: Re: [PATCH] vfs: Don't reject unknown parameters MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32252.1576604947.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 17 Dec 2019 17:49:07 +0000 Message-ID: <32253.1576604947@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miklos Szeredi wrote: > > So you could bloody well just leave recognition (and handling) of "sou= rce" > > to the caller, leaving you with just this: > > > > if (strcmp(param->key, "source") =3D=3D 0) > > return -ENOPARAM; > > /* Just log an error for backwards compatibility */ > > errorf(fc, "%s: Unknown parameter '%s'", fc->fs_type->name, pa= ram->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). The problem with what you're suggesting is that you can't then make /sbin/mount to use the new syscalls because that would change userspace behaviour - unless you either teach /sbin/mount which filesystems discard which errors from unrecognised options or pass a flag to the kernel to shi= ft into or out of 'strict' mode. David