Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp525186ybx; Tue, 5 Nov 2019 01:13:02 -0800 (PST) X-Google-Smtp-Source: APXvYqx+OM+XSxM0jIE8j7m2GA+QtkiEjzeVaL3B+2J00Ivkc9cc+wYAuSq65bLuC3mT6IC2DapH X-Received: by 2002:a50:f747:: with SMTP id j7mr24493276edn.247.1572945182587; Tue, 05 Nov 2019 01:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572945182; cv=none; d=google.com; s=arc-20160816; b=n2ohQ9TQmE7CmXHkwBITKvylGdKB/2QG81uNj/aFrpsOaV7sop5CbjYU3A+eZlDuQO YKUe0VRpj9SE8bxI3M7xjtnvlXllFcZn36vsDA2gLxfel0a6OiUF4nqiJm1uhICvzbg2 Sklu9Ap6ccqJZLFE+9ULEgoXqvJ4aQHafLleOLPBR7RA4FA8mZhxy08N5xIioZuDHbh3 epw9kXjRGsfyUk3xvQBZlQd8gCREMkwHYEKNExNreBE5jSpN31nCA4YUmEtwfPcDtQJa 0yZIQ7hzrkfRuQIWgK2YhI28SJZVwEYTy+X7+P9UDejP6x9gQpsW9P48PGPHic+0qKBD CwHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/7iMmW4I45P5C2mLqtbcuDjgQ0EnEpD0aF7HBwj+QTY=; b=f8rt+kbYAtnHtUVz14mV2SAMLNo3tvpbf3qbk7rLYSHZFXJKAtp4xVk4MR1JGKhJau eqYkcw5FpljYfUs9aG6xIqw1rFAgD1nSgZHXbKmea2OPPhXLsTzmog7PKiJjFys/rbbx n0/Hig5m2VjZPMaKSK3SoF+UiVUB7xrmne1WhQWYYRG8PNNejLuYIhsxd9RkZ8axbW8D Nrz+N8xta7xlvyQuqa+PkRcCf16zMuLB0dO5hD2PG7Q57p0g05lx1j+qDaOzPXd0HG5o 5SIlJx7rVjeexfyYoEwtiXsU2Xco4wOVxRaoM6oo/8XlwBJH3/34AX+MLd20wIbaoo5t 2amA== 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 ly28si916338ejb.177.2019.11.05.01.12.39; Tue, 05 Nov 2019 01:13:02 -0800 (PST) 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 S1730762AbfKEJJ6 (ORCPT + 99 others); Tue, 5 Nov 2019 04:09:58 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:9604 "EHLO mout-p-201.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730555AbfKEJJ5 (ORCPT ); Tue, 5 Nov 2019 04:09:57 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 476kQ90KYtzQlBP; Tue, 5 Nov 2019 10:09:53 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id fOLl1hihmqMD; Tue, 5 Nov 2019 10:09:46 +0100 (CET) From: Aleksa Sarai To: Al Viro , Jeff Layton , "J. Bruce Fields" , Arnd Bergmann , David Howells , Shuah Khan , Shuah Khan , Ingo Molnar , Peter Zijlstra Cc: Aleksa Sarai , Eric Biederman , Andy Lutomirski , Andrew Morton , Alexei Starovoitov , Kees Cook , Jann Horn , Tycho Andersen , David Drysdale , Chanho Min , Oleg Nesterov , Rasmus Villemoes , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Christian Brauner , Aleksa Sarai , Linus Torvalds , containers@lists.linux-foundation.org, linux-alpha@vger.kernel.org, linux-api@vger.kernel.org, libc-alpha@sourceware.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, sparclinux@vger.kernel.org Subject: [PATCH v15 9/9] Documentation: path-lookup: mention LOOKUP_MAGICLINK_JUMPED Date: Tue, 5 Nov 2019 20:05:53 +1100 Message-Id: <20191105090553.6350-10-cyphar@cyphar.com> In-Reply-To: <20191105090553.6350-1-cyphar@cyphar.com> References: <20191105090553.6350-1-cyphar@cyphar.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have a special flag to signify magic-link jumps, mention it within the path-lookup docs. And now that "magic link" is the correct term for nd_jump_link()-style symlinks, clean up references to this type of "symlink". Signed-off-by: Aleksa Sarai --- Documentation/filesystems/path-lookup.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Documentation/filesystems/path-lookup.rst b/Documentation/filesystems/path-lookup.rst index 434a07b0002b..2c32795389bd 100644 --- a/Documentation/filesystems/path-lookup.rst +++ b/Documentation/filesystems/path-lookup.rst @@ -405,6 +405,10 @@ is requested. Keeping a reference in the ``nameidata`` ensures that only one root is in effect for the entire path walk, even if it races with a ``chroot()`` system call. +It should be noted that in the case of ``LOOKUP_IN_ROOT`` or +``LOOKUP_BENEATH``, the effective root becomes the directory file descriptor +passed to ``openat2()`` (which exposes these ``LOOKUP_`` flags). + The root is needed when either of two conditions holds: (1) either the pathname or a symbolic link starts with a "'/'", or (2) a "``..``" component is being handled, since "``..``" from the root must always stay @@ -1149,7 +1153,7 @@ so ``NULL`` is returned to indicate that the symlink can be released and the stack frame discarded. The other case involves things in ``/proc`` that look like symlinks but -aren't really:: +aren't really (and are therefore commonly referred to as "magic-links"):: $ ls -l /proc/self/fd/1 lrwx------ 1 neilb neilb 64 Jun 13 10:19 /proc/self/fd/1 -> /dev/pts/4 @@ -1310,12 +1314,14 @@ longer needed. ``LOOKUP_JUMPED`` means that the current dentry was chosen not because it had the right name but for some other reason. This happens when following "``..``", following a symlink to ``/``, crossing a mount point -or accessing a "``/proc/$PID/fd/$FD``" symlink. In this case the -filesystem has not been asked to revalidate the name (with -``d_revalidate()``). In such cases the inode may still need to be -revalidated, so ``d_op->d_weak_revalidate()`` is called if +or accessing a "``/proc/$PID/fd/$FD``" symlink (also known as a "magic +link"). In this case the filesystem has not been asked to revalidate the +name (with ``d_revalidate()``). In such cases the inode may still need +to be revalidated, so ``d_op->d_weak_revalidate()`` is called if ``LOOKUP_JUMPED`` is set when the look completes - which may be at the -final component or, when creating, unlinking, or renaming, at the penultimate component. +final component or, when creating, unlinking, or renaming, at the +penultimate component. ``LOOKUP_MAGICLINK_JUMPED`` is set alongside +``LOOKUP_JUMPED`` if a magic-link was traversed. Final-component flags ~~~~~~~~~~~~~~~~~~~~~ -- 2.23.0