Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp524705pxa; Tue, 11 Aug 2020 08:40:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+CrxXheIgLNxU1n1Ohp6F9L9q0S0fHo0g7DaVf53QghtildVq50ir7q7704ZVZ42lPsN/ X-Received: by 2002:a17:906:6bc9:: with SMTP id t9mr26178590ejs.372.1597160426735; Tue, 11 Aug 2020 08:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597160426; cv=none; d=google.com; s=arc-20160816; b=PEMVjYea1Vm3W7ZAoZELgtBwQZLT59Y49/n/XHd0PMWsIRaBIapHTHA1M1UmjYVQFq V4YAO7bFld6/yBltopZJ4VMgCA+73y/WsNAnqOC6RK8REEOjDDtEC8TQlMFN0t5yCZsO /vq6/i0kNkLK4sq+ly+ZdP9XAmBPJ7GxEv4nU7AwLxz9sJdgIM/9Zz9Abu38SU4np0iQ EjakJtgcpV9i0t6dyyhIttepuEKDobUkP3NhUmhavi4cSV/gGkIMURG+0Phai3jdtJH1 gwE56vBSkOZLMnUlin7R4sI7ry5cAHCLARqz4WUHYFTTKiZYMsJa1WA7HgKCNM3Zcc7g SGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=k5Vv6xhQn88lB15k7GWg1mV+u5XAmiBOD5QRLYqo0NY=; b=gNB3i8yo8HJjwn6A7sniQ+4iGs73Wu6j2V+dxlkA/bHFIV8B9n6CDIzZA98CJRgDsj 2pILQDL7hEbd1PrbbAs4A44+wbOtcIIYSt/47EOuLzTfdgwliCHMQvlVmeHTNVOWoQcM des4RB7Q3KjevVvxtQHHKRY87C6kmQLkRLz/P9tlsdwjAvMFtUcQJEJXsgcnEpNuI0n+ Y1gyrRdmvVNrrFLB1uXRcsYncvHCObezH8V2UyiPJYNrXGe8a34rha225MnyLxKr1R7q kbxn3XvkPW9cSI8llaEOrp2Vj9jDhFCTsyrF4FYNp77WkP8mWWUmQY39XI4zKgGg1k0E bn9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=nHEtCEzA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si12842927edo.253.2020.08.11.08.40.03; Tue, 11 Aug 2020 08:40:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=nHEtCEzA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728907AbgHKPjc (ORCPT + 99 others); Tue, 11 Aug 2020 11:39:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728883AbgHKPj3 (ORCPT ); Tue, 11 Aug 2020 11:39:29 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAA87C06174A for ; Tue, 11 Aug 2020 08:39:28 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id r4so6998172pls.2 for ; Tue, 11 Aug 2020 08:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=k5Vv6xhQn88lB15k7GWg1mV+u5XAmiBOD5QRLYqo0NY=; b=nHEtCEzA+K3xCyhNyTZMcv8HcHHns+1Hk8pycDEXFieqNICHleSe+O63Dg8nrD0ywV o9FxDHPVmLM0E84TppnHf8iG7S6jFvmUO80JLVLQouLtTWeM771ruHtVW5aDq9qPlFD/ nPvs2QyLb4JcANu1Lw9v6YsDaxc4gzzjaYoAo+A4op1aaTwKJdGjDEBtT2htvCkHP/QB M2r/LMeVxfL75GbnkDd0Rr7a/6JSOT1h/M4gxH2FCh1IUGFdbam1qcqLH8k5yRdjSkoQ WGIhvHaJscZeR6w7h6ionNs/EknZAEI60DlrcQnPgdDW7ZSAV7EvgtRxy0pWXvYZnNYr I/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=k5Vv6xhQn88lB15k7GWg1mV+u5XAmiBOD5QRLYqo0NY=; b=I1wubIo/pR/wo181VFR+UwXIVuhKXPmPb8OKNhdrSCkCqkOFuGnmfKUqIGzBA7ev8V Cf0/rlR+rLBagxLkLrss0gN+d4IxhK4RZa4J3d8k60803wh8G07VzAP3ZWJhn3iruGK2 Q795LRjdIV0nul0Ej214a+8oRXQuPeJS8IpxpaOJ4+lJikIUoOYK2YB2JjufwuImLKva y6k6oRq9zegtiIbQKRZ/O3ABdoO4Z8+hGSbdrOSOvdrazxYffUW8yk+0TQmVrWhgaaHs UnO73oDRZ4NW0euntdsuvrqIikKe/IzeG6uFb7oSTuaD+7+/m34ezZFFvrCytvy+F/2k rtdw== X-Gm-Message-State: AOAM530GMnhHaHtPA7cnBM/5G2XyUbMAzv2diEDi+S+/K4YTmc/KmM8w StAAFKzBWbEiI+sowpqC6eZ9Kw== X-Received: by 2002:a17:902:8693:: with SMTP id g19mr1455443plo.66.1597160368219; Tue, 11 Aug 2020 08:39:28 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:6127:e67c:651c:a994? ([2601:646:c200:1ef2:6127:e67c:651c:a994]) by smtp.gmail.com with ESMTPSA id 193sm25644247pfu.169.2020.08.11.08.39.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2020 08:39:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) Date: Tue, 11 Aug 2020 08:39:26 -0700 Message-Id: <5C8E0FA8-274E-4B56-9B5A-88E768D01F3A@amacapital.net> References: Cc: Miklos Szeredi , linux-fsdevel , David Howells , Al Viro , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , Ian Kent , LSM , Linux Kernel Mailing List In-Reply-To: To: Linus Torvalds X-Mailer: iPhone Mail (17G68) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Aug 11, 2020, at 8:20 AM, Linus Torvalds wrote: >=20 > =EF=BB=BF[ I missed the beginning of this discussion, so maybe this was al= ready > suggested ] >=20 >> On Tue, Aug 11, 2020 at 6:54 AM Miklos Szeredi wrote:= >>=20 >>>=20 >>> E.g. >>> openat(AT_FDCWD, "foo/bar//mnt/info", O_RDONLY | O_ALT); >>=20 >> Proof of concept patch and test program below. >=20 > I don't think this works for the reasons Al says, but a slight > modification might. >=20 > IOW, if you do something more along the lines of >=20 > fd =3D open(""foo/bar", O_PATH); > metadatafd =3D openat(fd, "metadataname", O_ALT); >=20 > it might be workable. >=20 > So you couldn't do it with _one_ pathname, because that is always > fundamentally going to hit pathname lookup rules. >=20 > But if you start a new path lookup with new rules, that's fine. >=20 > This is what I think xattrs should always have done, because they are > broken garbage. >=20 > In fact, if we do it right, I think we could have "getxattr()" be 100% > equivalent to (modulo all the error handling that this doesn't do, of > course): >=20 > ssize_t getxattr(const char *path, const char *name, > void *value, size_t size) > { > int fd, attrfd; >=20 > fd =3D open(path, O_PATH); > attrfd =3D openat(fd, name, O_ALT); > close(fd); > read(attrfd, value, size); > close(attrfd); > } >=20 > and you'd still use getxattr() and friends as a shorthand (and for > POSIX compatibility), but internally in the kernel we'd have a > interface around that "xattrs are just file handles" model. >=20 >=20 This is a lot like a less nutty version of NTFS streams, whereas the /// ide= a is kind of like an extra-nutty version of NTFS streams. I am personally not a fan of the in-band signaling implications of overloadi= ng /. For example, there is plenty of code out there that thinks that (a + =E2= =80=9C/=E2=80=9C + b) concatenates paths. With /// overloaded, this stops be= ing true.=