Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6204375iob; Tue, 10 May 2022 12:46:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy3wmVI663FQ+qfY6Gmt4fnIE4utG+UKsdfu0j07cwpXXLcO0VkxPxUKKVV6y8mxn41d0s X-Received: by 2002:a05:6870:961b:b0:e2:ffb9:f526 with SMTP id d27-20020a056870961b00b000e2ffb9f526mr1008512oaq.146.1652212013691; Tue, 10 May 2022 12:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652212013; cv=none; d=google.com; s=arc-20160816; b=eMwRvbb+NUdkFYtKf8P3XgcgNzJxJPURsQ03aoOrzZUXIw1gxrJNCMy95qo9b4CSC9 +WLfunIkjGzTwIxY/ixAyFw7kH/WfZhHchm2MajouGRJFhVB61wU2l5JM3fBVkzwPAoO e9Um89/lfEP53TdRB56pyPMtwhuk0pv22veEgapYrf16XIGbkSyy0JXbn/Z/fZfhNFdo F9zHnHFbrGkagyuSuiKhBWHxrCNlUgKtj6VX/CdppXdqhOA6UcmNT3LGWQfuIRuikct0 iIK/OR6FBK/LVY3OeIF0ocYRg2vYtJwgctjegekjI9VwBwXRUFl35Yr9+kt9dq40XHYX 755Q== 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=AR2rQ5D4sal4yeuFvvLgYhsYao0ssgsZ8x7ynzFAINo=; b=To7uNhZGpdBUrw9Zt0MIsBVpPtbCKhWsb7UdqTfcKb+kK/DNVYDIpQjtm8kXaCxRjw fPA6sT39vf0/Vs6EuTFlsiaJ/IeZE60+MshpkuSdeYEVTFfk0xn/g59upJFbkRcrU3ph E2Xq1OAR9FDwoSXs9XCL7fSyetuKrvOoKrIvlo/JZLGP+2XO3juNwhsYHy4zgB/w1OFA S0rgsbzWALmtilL7iK2iykYeaonLzccSHgJ2QMz6xYnr+XcJn6rItucTit2jwxQwUhP+ zg+/6Wc66pijBerEiLdkkKgOEMc/ZY4kfNxAcqimWIcVdm0yFLnCETvUZ0PUY2lSJKBW VWmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tJYOp3WJ; 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 lm19-20020a0568703d9300b000e99eaafa67si13340103oab.130.2022.05.10.12.46.39; Tue, 10 May 2022 12:46:53 -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=tJYOp3WJ; 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 S1345166AbiEJO6r (ORCPT + 99 others); Tue, 10 May 2022 10:58:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345121AbiEJO6M (ORCPT ); Tue, 10 May 2022 10:58:12 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8CB82A76B4; Tue, 10 May 2022 07:19:43 -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 sin.source.kernel.org (Postfix) with ESMTPS id 33131CE1F30; Tue, 10 May 2022 14:19:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82064C385C2; Tue, 10 May 2022 14:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652192379; bh=4obB5yZPo6qtD+4LbLaRZZjIPI7HGIIXta3dnnaLaA4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tJYOp3WJgQmgO//N8yYXAhgWomyLHhhikZ1zpaco+76CnmhwQ2xvz4LT0+nSITpvZ 5ZBckNEnTZcrp3OiIKkg538FXEOuqVsJoFaEIG4yX1QqftrV1nEv5s//qnEcgnOBV7 Xi+Hhc+7dBhwMKhWVMESKPBan0XlbG8NibNM2MAsnSOfzO3dD72z3E2/mCVvTwLSSM feq24xy/OFc4xbakrYzNLbeV1EuNcwqpyV6evlI9Nwv2lcCa/FqbDJvsyqehQYOp9e 4ikYSS3PUdtH39aCqR0FWk3JIVSdwhophVEVBcX7DigC8UBChyCZwXC681AF+yMnhm je4agOQF7a5Gw== Date: Tue, 10 May 2022 16:19:32 +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: <20220510141932.lth3bryefbl6ykny@wittgenstein> References: <20220509124815.vb7d2xj5idhb2wq6@wittgenstein> <20220510115316.acr6gl5ayqszada6@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 03:15:05PM +0200, Miklos Szeredi wrote: > On Tue, 10 May 2022 at 13:53, Christian Brauner wrote: > > > > What exactly are the attributes that systemd requires? > > > > We keep a repo with ideas for (kernel) extensions - we should probably > > publish that somewhere - but the list we used for a prototype roughly > > contains: > > > > * mount flags MOUNT_ATTR_RDONLY etc. > > * time flags MOUNT_ATTR_RELATIME etc. (could probably be combined with > > mount flags. We missed the opportunity to make them proper enums > > separate from other mount flags imho.) > > * propagation "flags" (MS_SHARED) > > * peer group > > * mnt_id of the mount > > * mnt_id of the mount's parent > > * owning userns > > Sounds good thus far. And hey, we don't even need a new syscall: > statx(2) could handle these fine. > > > There's a bit more advanced stuff systemd would really want but which I > > think is misplaced in a mountinfo system call including: > > * list of primary and auxiliary block device major/minor > > It's when you need to return variable size arrays or list of strings > that the statx kind of interface falls down. > > For that a hierarchical namespace is a much better choice, as it can > represent arbitrary levels of arrays, while doing that with a > specialized syscall is going to be cumbersome. > > > I just have a really hard time understanding how this belongs into the > > (f)getxattr() system call family and why it would be a big deal to just > > make this a separate system call. > > Fragmenting syntactically equivalent interfaces is bad, unifying them 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.