Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1053041imd; Sat, 27 Oct 2018 00:54:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5dKNcxt5jxnP9rsYvVRGT+fas9HogXv8hI49y6qvGNRpc7gVhRegtNpE3Cm2ZwyRw2YEXOF X-Received: by 2002:a17:902:2849:: with SMTP id e67-v6mr1655480plb.269.1540626879168; Sat, 27 Oct 2018 00:54:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540626879; cv=none; d=google.com; s=arc-20160816; b=Ic+vlpiTVhYpo3ddxRhPnMiSh0KW8yLnP2vASzGkt/41duFiZOE6hIFCLCBb05XIwI yCCBpC1vQ6eTOqpmnDVFGevT1cWq5LK5pHNwqaaEMVfG1sOuMol/xzgm3mznrUKgP5B6 cicOSv9BqJnSQ+rgEfNHqbMRvtK1DlR5TIAPMRint/uVFLo3tOxUf6T6tsFmDEaCwpzF 44AqPeNgAV+gQFuKNW5hJ3FbqGJkpOoc0lIvL02T5d2QLnPSiqpL4Q/BdktzknLoaQGM fQYOL/PD1CPDBUgsm/H/5v6/c2JlcMdVqwvDHSw9YMmOlyVfpwP0E3ONKs39JukqR1sz 4g2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wMRYPc5wvwkFCCQZKWuEJFgpGjR6IOY/FjV4xu1d3ow=; b=VzG4YyYFCIwQ9wOchATQB3LgEs601HqmPdkaijvh5Ecayk+AT0laPC/YyiR3y3DTXM bLzSUvGZfzOTOk5WZ3Hq40FDqWVFd7YmRyybPtXHFtTf80sadLEtPDZQV8FKoXeuf7nC iMdaoy3JBEYr6NcXfAg5nQj7malrBaHcq4RCijunD/yvj03b1cromb0npmf4Ru8KzfoN dlqlj96RC7b3bzYZETNbAHtqfNWTnYAgqyPWsT8KNOPmusKHMIqiMZVlu7caRPWuSwR6 0wRHlowtZL7YOFcGWh2yYyzy565jMKr7IwWvcB2alkmXLQMlvvaB3Plv2P5OQEs7528f jUXw== 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 a18-v6si2791201plm.41.2018.10.27.00.54.22; Sat, 27 Oct 2018 00:54:39 -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 S1728279AbeJ0QeA (ORCPT + 99 others); Sat, 27 Oct 2018 12:34:00 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:45818 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728199AbeJ0QeA (ORCPT ); Sat, 27 Oct 2018 12:34:00 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGJPp-0005AH-2E; Sat, 27 Oct 2018 07:53:49 +0000 Date: Sat, 27 Oct 2018 08:53:49 +0100 From: Al Viro To: Aleksa Sarai Cc: Ed Maste , David Drysdale , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] namei: implement O_BENEATH-style AT_* flags Message-ID: <20181027075348.GN32577@ZenIV.linux.org.uk> References: <20181009065300.11053-3-cyphar@cyphar.com> <20181027014114.GA52393@freebsd.org> <20181027071729.xbnvfii6iwdwymrn@ryuk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181027071729.xbnvfii6iwdwymrn@ryuk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 27, 2018 at 06:17:29PM +1100, Aleksa Sarai wrote: > I'm going to send out a v4 "soon" but I would like to know what folks > think about having resolveat(2) (or similar) to separate the scoping O_* > flags and produce an O_PATH -- since unsupported O_* flags are ignored > by older kernels userspace will have to do some plenty of checking after > each path operation. > > Personally, I believe this (along with AT_EMPTY_PATH for openat(2)) > would help with some other O_PATH issues. The trouble with resolveat(2) is that for anything directory-modifying you really want directory locked before the lookup for last component. IOW, funlink(2) et.al. are hopeless. You can, of course, do O_PATH open for everything sans the last component, and do unlinkat() with the base being the result of that open and the last component for relative pathname, but that takes more work on the userland side than you probably want to bother with. IOW, pathname resolution for directory entry is seriously different from that for fs object. And you obviously don't want to return from a syscall with directory locked.