Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp554970pxa; Tue, 11 Aug 2020 09:18:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKF65A2E3YzZiD9rZo40fdecXtyPQ2mbY0V1uQoSkYhcoD4eZKB0O6b2bqRbvt/fp/q8VH X-Received: by 2002:a17:906:9385:: with SMTP id l5mr26669998ejx.144.1597162724435; Tue, 11 Aug 2020 09:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597162724; cv=none; d=google.com; s=arc-20160816; b=VDZD6wB4hJ6hAr1wD00B4swnDmh5Vmo+DgN/67PYKvYhbIO4BhcJ062SkuyPpTNxg9 j5sC3DkIn8t17/ZoGQhVhI2vgBdT57h2jgUI9/IifzcjU/LoHkwU0wj58dYgWD2uWV/p KFy58wzCsMyXbxFdGBJ/vGdlhC1FhSLKuNyEc78xxds9N0mBkzLaNPMSMOVx/Ihir3t4 XqRUVmYknW3sDz8RHnikb8GPQgChTyXVJkwj2cXbmv8IDUrLiWCPiG+McK7xOdwQA46R HBEZIqrtfkbK0Pulm7C19W1dc6z7U6JtpiH67TpoVFosdsJ43bpc5YaCTl44tug0hemY fjiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=HRZtQQztfeaIlu0ko1fCcbZ7lwBJIQ6owO2QXWY3TpA=; b=kRDdU0lEJeOVweryaTmvnfxCgfY6QojGMl3FSo/Aq5yj1tcC0pN0XZwrfnOPWb+UpU Aqa83eZJMmoo4D43pX9Z6U+p8Eq7Fygjq8Bz0izJV8wHGFzZUU6LJL6zlbBxTdDZl4FH NoMeOBiHYV4mvGQ/t6USnPgctoMZ3EtUFsFVrhtqqx+ZOjZFKL7eJLJNMZQYVWcWgSAy bMvsYg6gaHE84laWu0YYwmaHtdJxHT2eNrSyZCnyluT06SKsKpUrg/pjY1VBPVdSxRJL mmy9MV69nikwXS6JOkQffg17cU4FdDr6NrRoIMzT6pOaTCAnSMklbcnbF1nMLD6bM6rl I5tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=IPWlCwNc; 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 e12si12710681edy.213.2020.08.11.09.18.21; Tue, 11 Aug 2020 09:18:44 -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=@yahoo.com header.s=s2048 header.b=IPWlCwNc; 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 S1729029AbgHKQRr (ORCPT + 99 others); Tue, 11 Aug 2020 12:17:47 -0400 Received: from sonic302-27.consmr.mail.ne1.yahoo.com ([66.163.186.153]:40452 "EHLO sonic302-27.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728947AbgHKQRq (ORCPT ); Tue, 11 Aug 2020 12:17:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1597162664; bh=HRZtQQztfeaIlu0ko1fCcbZ7lwBJIQ6owO2QXWY3TpA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=IPWlCwNcLYacS9jhqVwBCI39xmuZbEhVmcIL4ATgtdTJZIn2MjxFnfGlwEW2N3jfIf3eXTfsa1CexGQSmiZ8XVpWzx8YfK3Ue925slZDtSdT6ATSmHeThsm/CXPD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aUNO3KKCIGxbZ6PccFGxNWR7ZIeRvELvNqTPBEzGhs_BVOtnhSk_iOenuZMy93 2tUJPjtsKAo7MzdyZWRo1ZjicFi2ugZl8S91eO9E2FpEDQcvXeLRBigriaGsL8loNsTvaMt37bUW Qi0pB.KVwOSxP6p0EMHP0Zu.OQ4S2rl6fOW3PkQ7UsbZPuDj3gL0R3wfEekvIubU9jZ3PtI54RPv jWHVQxfynP_bVu.XlLp6KeGtyOT4pe0GX0UtzTGHO7UVvCsC7BmR3hwmQJeZQ9xqOEM2k7ga.w.T nITKvJiivAjdReWCrxbzA8P03YpCHlH_sNvg93f6WvBxrxNB32P98FGckV6zAXvrQNMuhqaBWwUy idJfhI8Pk7dZhrGBhT.ICul4cC6cVmeFfSJpflIXE14tZgLESibJHpUWE.lLhpGn0s0nDt1OphSO bF1SBwr2yy3B7h6XGdcj.XGiggMKc_U1zaBalh6LUQRgA24cXIkausF1JldoDneZ4_Bl6yhwQ5uH DbS5df3OEJIirSPa5Crbk07bApGPPrNHz0WkVgzm1B35re8UWBPoq89bPZudrWMbOWBrolqmMMXX a1o96zvKEBpjZhA1GQHJTgHikR1I62NK0kdDMrmVlWXUjlYDhckdvJWaj6AdXYyP50jhtLUr4KMJ KsnCgfVEpXeWDmWNvh1EWh_k- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Tue, 11 Aug 2020 16:17:44 +0000 Received: by smtp412.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID c3db567eaf5f6f2d02d37813dbea7c10; Tue, 11 Aug 2020 16:17:41 +0000 (UTC) Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) To: Andy Lutomirski , Linus Torvalds 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 , Casey Schaufler References: <5C8E0FA8-274E-4B56-9B5A-88E768D01F3A@amacapital.net> From: Casey Schaufler Message-ID: Date: Tue, 11 Aug 2020 09:17:39 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <5C8E0FA8-274E-4B56-9B5A-88E768D01F3A@amacapital.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Mailer: WebService/1.1.16455 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Content-Length: 2347 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/11/2020 8:39 AM, Andy Lutomirski wrote: > >> On Aug 11, 2020, at 8:20 AM, Linus Torvalds wrote: >> >> [ I missed the beginning of this discussion, so maybe this was already >> suggested ] >> >>> On Tue, Aug 11, 2020 at 6:54 AM Miklos Szeredi wrote: >>> >>>> E.g. >>>> openat(AT_FDCWD, "foo/bar//mnt/info", O_RDONLY | O_ALT); >>> Proof of concept patch and test program below. >> I don't think this works for the reasons Al says, but a slight >> modification might. >> >> IOW, if you do something more along the lines of >> >> fd = open(""foo/bar", O_PATH); >> metadatafd = openat(fd, "metadataname", O_ALT); >> >> it might be workable. >> >> So you couldn't do it with _one_ pathname, because that is always >> fundamentally going to hit pathname lookup rules. >> >> But if you start a new path lookup with new rules, that's fine. >> >> This is what I think xattrs should always have done, because they are >> broken garbage. >> >> 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): >> >> ssize_t getxattr(const char *path, const char *name, >> void *value, size_t size) >> {known >> int fd, attrfd; >> >> fd = open(path, O_PATH); >> attrfd = openat(fd, name, O_ALT); >> close(fd); >> read(attrfd, value, size); >> close(attrfd); >> } >> >> 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. This doesn't work so well for setxattr(), which we want to be atomic. > This is a lot like a less nutty version of NTFS streams, whereas the /// idea is kind of like an extra-nutty version of NTFS streams. > > I am personally not a fan of the in-band signaling implications of overloading /. For example, there is plenty of code out there that thinks that (a + “/“ + b) concatenates paths. With /// overloaded, this stops being true. Since a////////b has known meaning, and lots of applications play loose with '/', its really dangerous to treat the string as special. We only get away with '.' and '..' because their behavior was defined before many of y'all were born.