Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6196401iob; Tue, 10 May 2022 12:33:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2cHJ35RQ5f94G71V1kHZ9hVIlZHF2V7dekbulHF1TjlCswIDxukUCyB2lk19Om4oDGEsI X-Received: by 2002:a63:d07:0:b0:3c2:7317:24c8 with SMTP id c7-20020a630d07000000b003c2731724c8mr18075343pgl.109.1652211221659; Tue, 10 May 2022 12:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652211221; cv=none; d=google.com; s=arc-20160816; b=orFX7fzT60XAGtf2YYX3p6VStF0v8AGk4hLTCK1zApXQdV0dCG4Yc7cioXxlXyfQhq xqShKDwvptY9Aflaqq7lX3whLUx3jKzoBGTgqEUe1AEWIjUPkU7H0Et43ZGUyMvDB6hK 2CCO4YDSfPkG7AXLqQ2akmQndP3CBhiPyOc8yoxeZcQlo1c/7AXxXiqkI7VY+9xsuTUL zBapkZzVtuGNPPJGbLb+Y1OFJWD30xYM5njZItoX1hjRyGahL7dXScgxpg9pSdxoCTaF 5p13gw3TaA6nt+YwMzFGAQK8y9j5EowThJU1hRx1ssAo6rBUtcBCimA+pWH+0jwXhjIu tQjQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=s5BLvZAYILSB12nZuAkgSKevQqQNQy4I1Y8mznAAwo4=; b=MZRoxKGLIxmLte33Tb1v3HHZ8H23sCLxe2kLDbuo5s7TVOvWZ+Kwco/Lva2MAnwsrh IeHHeS1HdE/tLnoaF68MiOfepB026aQdqzyMbdib91kP8WKR4V4nHl1l2+xIalocQ9Ii ecdIsBEPNDpfSGJWXzs09xnOOclU7jleotz8GyoAbjA8Yol5PTEkG7kkCmnYT2ylRBCB 1wYqy6NEycoBTBBu9B4QtzDfO62vVPvzPv2m3cw8o3Zm2+RqjRw1uZPnU0BeWuI3DCZg Ant0L2EyrWbB8Q4Wexlm7HaohAHiaVErSqngIo4g77J+kX06TrEV0zoPTSK0r41iOvMc K9sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lNXs8Q6V; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a63f44d000000b003aa65330b92si238941pgk.486.2022.05.10.12.33.25; Tue, 10 May 2022 12:33:41 -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=@kernel.org header.s=k20201202 header.b=lNXs8Q6V; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345837AbiEJPiG (ORCPT + 99 others); Tue, 10 May 2022 11:38:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345971AbiEJPff (ORCPT ); Tue, 10 May 2022 11:35:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2782C3B574; Tue, 10 May 2022 08:31:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ACCA6B81D7C; Tue, 10 May 2022 15:30:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C68EC385C2; Tue, 10 May 2022 15:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652196657; bh=S6exA6OSyNi01JKIfIMf9AjDS/wnlwFSx2RTUuwC2CM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lNXs8Q6V+p1cDUy2KdDM13MJl3NoY5Qdq/BwxZegnMRh/5ZI29oP1SPUkaBoDIGCV TRre5hHPsOtIqmvWOicVnIVAb69UshJhuh5Hn99PJZSqYrNXj+PEsbz00L2u/60aiy j/FmlT3/v5f6i27tQ3nCUDKETS37dKvkAokYkmfCcvj0jeFCRHv+QYEjusHvlLhp89 7ytt5cHhPBXg6wivc7CRGViEZUUDaQ/784NyBc5Bri20QayljHQ8hiEsos+SZktroI zT+IFRGAHv991qAJXSy2bRr4D8ys4ClAXT8buFbLgaUzPyTnlFf0byM0DdjSi8okVb W1diT2O5XTk/w== Date: Tue, 10 May 2022 17:30:50 +0200 From: Christian Brauner To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, Dave Chinner , Theodore Ts'o , Karel Zak , Greg KH , linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Subject: Re: [RFC PATCH] getting misc stats/attributes via xattr API Message-ID: <20220510153050.cgbt3wezbvf2jfnb@wittgenstein> References: <20220509124815.vb7d2xj5idhb2wq6@wittgenstein> <20220510115316.acr6gl5ayqszada6@wittgenstein> <20220510141932.lth3bryefbl6ykny@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, May 10, 2022 at 04:41:35PM +0200, Miklos Szeredi wrote: > On Tue, 10 May 2022 at 16:19, Christian Brauner wrote: > > > Fwiw, turning this around: unifying semantically distinct interfaces > > because of syntactical similarities is bad. Moving them into a > > syntactically equivalent system call that expresses the difference in > > semantics in its name is good. > > You are ignoring the arguments against fragmentation. No, I'm not ignoring it and really wasn't trying to. What I tried to say by this, is that the inverse of the argument against fragmentation is simply equally worth supporting. Meaning the argument against fragmentation isn't stronger than the argument against aggressive unification. (Fwiw, I think that basing the argument on syntactical similarities is problematic. Stretching this argument for a second, all multiplexers are almost by necessity syntactically similar (e.g. ptrace() and seccomp()) but we don't use that as an argument to make them a single system call.) > > You are also ignoring the fact that semantically the current xattr > interface is already fragmented. Grep for "strncmp(name, XATTR_" in > fs/xattr.c. > > We don't have getsecurityxattr(), getuserxattr(), gettrustedxattr() > and getsystemxattr(). It would be crazy. Adding getfsxattr() would > be equally crazy. getxattr() pretty much describes the semantics of > all of these things. getxattr() describes the syntax of all of these things and barely that. It describes the method of retrieval. And the method of retrieval is super generic to the point where strings _or binary data_ can be returned (e.g. POSIX ACLs or fscaps) depending on the xattr namespace. But wight now, everything we currently get from getxattr() is attributes associated with inodes. So getsecurityxattr(), getuserxattr(), gettrustedxattr() etc. would arguably be fragmentation because all of these things are associated with inodes. But now we're in the process of extending the *xattr() calls to operate on mounts and filesystems so an additional getfsattr() (or another name) is not fragmentation imho. And I definitely don't think this would qualify as "crazy".