Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp861523ybh; Thu, 12 Mar 2020 12:27:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtPlfvrj/p07ZZNQ4h5hlvAk1TSmbX1ysTfJi/B1XZdnktI5mBvCyUwAoIxWxKwcfMKHh24 X-Received: by 2002:a9d:2226:: with SMTP id o35mr4498461ota.261.1584041255289; Thu, 12 Mar 2020 12:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584041255; cv=none; d=google.com; s=arc-20160816; b=fqKOHc+Oyi4RMwiwJkD7kf+wI9hi1P9WigjbkSQZYGre2mK1G9trF7H5wU+ehyxVzG 8M3cXiI6D4aJDDsUbniC+lTktimseFIpRo8ZdWLN3qoh6tyuI7p1iOX0PZoXuguqnDxo NOlBPYgycis31ykCxvDXOe73+6dc0RUNUmWBmq8Lgi4zB5V3zSiz4+SnkcF+9laEJlmK KG3eCtlx5wtrkHO3RC0hO6nLH6GrBJ4nGj2kZgySyF2LhUC5TlPnqBmitRMAHpNvDwG5 a69CwW1sUfdEg+3rHgUnd38LSRKbKcEzsLvgfuGdchvu8FnG8GJSrnnuJhTwvQVJ4ZCh Hu0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=/3PbTGA5BOIlPXoRQ1xA3cuy2Pou2dTHtmKBpNPbSUc=; b=Hnm1tyYV5gJt5yXWlYNt1D2wdHSTkHWyUJDwsXBjG9rv7iA837XWLrq9fa/75PGkOV LeRgXKj+2OiHblBZMDf8VNnegtjYszE0MWBPaQejNSTjrF3LaG856+yP/hnq6phdi5pj XD+vuivAlhxA4IkwiBYzCZ7M4oe1ngZY4rvAZkrrxknPnD/+Oqgah4LWdl2btrwzid5B oIAN5I/CEaP3lqnP22nUKeHsbx8m2QIhpPujz9WfJRoF7Oc9Jn5vSlQA/pgh8zHuAQaY 42RSEX4lAL0wewJ8WR3+RYjoTW7MiRFEOLRDF2h5vN1TMvfXBlSDOqsSNaHjbzbPLEsl SiQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v129si2847531oib.58.2020.03.12.12.27.22; Thu, 12 Mar 2020 12:27:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbgCLT0g (ORCPT + 99 others); Thu, 12 Mar 2020 15:26:36 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:56540 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbgCLT0f (ORCPT ); Thu, 12 Mar 2020 15:26:35 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCTSq-00AIsn-AL; Thu, 12 Mar 2020 19:25:52 +0000 Date: Thu, 12 Mar 2020 19:25:52 +0000 From: Al Viro To: Linus Torvalds Cc: Stefan Metzmacher , David Howells , Aleksa Sarai , Ian Kent , Miklos Szeredi , Christian Brauner , Jann Horn , "Darrick J. Wong" , Karel Zak , jlayton@redhat.com, Linux API , linux-fsdevel , LSM List , Linux Kernel Mailing List Subject: Re: [PATCH 01/14] VFS: Add additional RESOLVE_* flags [ver #18] Message-ID: <20200312192552.GK23230@ZenIV.linux.org.uk> References: <158376244589.344135.12925590041630631412.stgit@warthog.procyon.org.uk> <158376245699.344135.7522994074747336376.stgit@warthog.procyon.org.uk> <20200310005549.adrn3yf4mbljc5f6@yavin> <580352.1583825105@warthog.procyon.org.uk> <3d209e29-e73d-23a6-5c6f-0267b1e669b6@samba.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 09:24:49AM -0700, Linus Torvalds wrote: > Would that be basically just an AT_EMPTY_PATH kind of thing? IOW, > you'd be able to remove a file by doing > > fd = open(path.., O_PATH); > unlinkat(fd, "", AT_EMPTY_PATH); > > Hmm. We have _not_ allowed filesystem changes without that last > component lookup. Of course, with our dentry model, we *can* do it, > but this smells fairly fundamental to me. That's a bloody bad idea. It breeds fuckloads of corner cases, it does not match the locking model at all and I don't want to even think of e.g. the interplay with open-by-fhandle ("Parent? What parent?"), etc. Fundamentally, there are operations on objects and there are operations on links to objects. Mixing those is the recipe for massive headache. > It might avoid some of the extra system calls (ie you could use > openat2() to do the path walking part, and then > unlinkat(AT_EMPTY_PATH) to remove it, and have a "fstat()" etc in > between the verify that it's the right type of file or whatever - and > you'd not need an unlinkat2() with resolve flags). > > I think Al needs to ok this kind of change. Maybe you've already > discussed it with him and I just missed it. They have not. And IME samba folks tend to present the set of primitives they want without bothering to explain what do they want to factorize that way, let alone why it should be factorized that way...