Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp567899pxa; Tue, 11 Aug 2020 09:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKGrmpB3awkclnxwEpzk7UgtZZxGOYLFfCywzO8gIj+rdjYa0UR0NuNAqbK0pCPcFlTBvf X-Received: by 2002:a05:6402:1c85:: with SMTP id cy5mr14464981edb.6.1597163732746; Tue, 11 Aug 2020 09:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597163732; cv=none; d=google.com; s=arc-20160816; b=U9fLAXFv2XjYaHizy255D+3qiNUyOPwmIh4YPYeRG2lvhCOpAnBErjKN0OlLYeh0+g /vh7CgBLJkGn5wtxk3LJQAgFavyjHQvr9RiQsQG9RcG68GCHgA/fqYEejbryC3Rc3B4L 3z9Ts7t7Z27doesKsTl5pjD7pVVfMI/n4cS4xk0muWO0Lq0h4tRZ6shJ3o/YZlSDSYRb q4PUdnRJ4gJ9ikbZ5WTlf/ohBSbuHh+fZ2vZL0GpDjTuA1oELe4XxnK7sG/H34OUVsJy BxWH8d8Vjzw26B2e7JoPOb6hCTOD+pfKVso0KrLjT2lLdIM7NZEckpwIF272giSrU6ik YElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=N7traUqX1fM13wKjAbxkcSlNBWmdCV6QJf9i7XpWydE=; b=NjwFoHiU/gL3StSGtFJzGxGdboxYSE6qOxzdwhxeeQ8CoVqnOjPUdmlEg/tRqkgL0r SIDL+o53/HAZLufOTdxdEyE6ABYG55RAJ8gSTn93ntLlRy1O8eaYR24zV9xMjxJ8O6la Biqw7FAocKk1NGpUc5Ld/odvJvOYhkI3NlC0eBxo+JmMehi9l7mlX7NUaA3K6iTu2MLx 5xUnDdJ4smC/u+xAni6NuXzy37OHGYBpOroCRZ+/zFYtaFXhpC5562yxVOavQOfPZl/A qTEgnL6NN0AEd+hCtSFUW2xEK1Hg/tjOwVM5FDz2aQSYpwKnVND/0tUs72+mu856I2Mc 4vSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=WPJKoAqH; 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 j23si12353372edp.162.2020.08.11.09.35.07; Tue, 11 Aug 2020 09:35:32 -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=@linux-foundation.org header.s=google header.b=WPJKoAqH; 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 S1729314AbgHKQb2 (ORCPT + 99 others); Tue, 11 Aug 2020 12:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728862AbgHKQbJ (ORCPT ); Tue, 11 Aug 2020 12:31:09 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E160C061787 for ; Tue, 11 Aug 2020 09:31:07 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id g6so14186340ljn.11 for ; Tue, 11 Aug 2020 09:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N7traUqX1fM13wKjAbxkcSlNBWmdCV6QJf9i7XpWydE=; b=WPJKoAqHiSl/tMI6ux9ZyiwFZyLZeSf9IYnGPT6aXv5JxD0edUrsFyfwibupSRZPli sRgA0IHx4UhfQY9IUr+rb1b91G/QJ4IOfgHOH9XwY0IGnWNZoZAF+orZ9O7vZ9YyH60H QN4mw78jv4VsrakmBralo6Vc4sNZK78skPMUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N7traUqX1fM13wKjAbxkcSlNBWmdCV6QJf9i7XpWydE=; b=Rsq+o8ja6rrWBDZN/PnlNI0w+FofDbxtG/oArzKv7bZSfJ+wrrKyVH4YQk1dcPpM4e Hi4JEwoKJHxdb3U7i87+FiGWMihZ0Ct++xfzfoF/RRZRMo8fXRffh7lPAP4f1bY9M6rG ix01sTpNe94wl6lBFUC2a2t6JGSSO2S6TAP56oQJ28qNfFMZo9YS5xrfj0Hf+KaB2RbV LdNNn3ezGHslFSrtoffGe+3xJOw6lLSOgurZyM4FGv5+J81+A+EAh7kuacT+2zUDNpWR vmjXUdKB/2YSq0YKgEu77jLJog93qk2Pg79g/KQE0hN+Jn6vw8M6bopm7J2Ptl35lcrx UqWg== X-Gm-Message-State: AOAM533Htvplbq0uS6Hs1CrmJyY+cpqqqe2mVj68C51k8tbQ3bv2Li3a 4OaFhXu1sdMGL8R7d4AItgXVHBK3LFM= X-Received: by 2002:a2e:b619:: with SMTP id r25mr3697568ljn.220.1597163465442; Tue, 11 Aug 2020 09:31:05 -0700 (PDT) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id a30sm11702806lfo.1.2020.08.11.09.31.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2020 09:31:04 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id 185so14210519ljj.7 for ; Tue, 11 Aug 2020 09:31:04 -0700 (PDT) X-Received: by 2002:a2e:9a11:: with SMTP id o17mr3282002lji.314.1597163463666; Tue, 11 Aug 2020 09:31:03 -0700 (PDT) MIME-Version: 1.0 References: <5C8E0FA8-274E-4B56-9B5A-88E768D01F3A@amacapital.net> In-Reply-To: From: Linus Torvalds Date: Tue, 11 Aug 2020 09:30:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) To: Casey Schaufler Cc: Andy Lutomirski , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 9:17 AM Casey Schaufler wrote: > > This doesn't work so well for setxattr(), which we want to be atomic. Well, it's not like the old interfaces could go away. But yes, doing metadatafd = openat(fd, "metadataname", O_ALT | O_CREAT | O_EXCL) to create a new xattr (and then write to it) would not act like setxattr(). Even if you do it as one atomic write, a reader would see that zero-sized xattr between the O_CREAT and the write. Of course, we could just hide zero-sized xattrs from the legacy interfaces and avoid things like that, but another option is to say that only the legacy interfaces give that particular atomicity guarantee. > 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. Yeah, I really don't think it's a good idea to play with "//". POSIX does allow special semantics for a pathname with "//" at the *beginning*, but even that has been very questionable (and Linux has never supported it). Linus