Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4103755pxf; Tue, 16 Mar 2021 06:01:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlgdnqHLM4tBzifTU5EPWelxSvoayQ26Ubg7s/3UMof+I5EDBJVi4Eeh4bq1kOK1SGqUPW X-Received: by 2002:a05:6512:3290:: with SMTP id p16mr11133111lfe.150.1615899672022; Tue, 16 Mar 2021 06:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615899671; cv=none; d=google.com; s=arc-20160816; b=qRSLNLlPYZOOsKouIpL+5WvXMmYiW5JymwTWq+5CRQPUT8D8Ph9TUrCrjHEu9mfWdd QanOxlxzCrINhzBrejll0n9wa5V3DCdC48/4ZTuUrL7b/eIVNG6/XxpUVlIjuGCQqcix N3rmEcmf+RBb2nzRRuHNeBL2S/ardR1psatxB8siJ3KITCLMwqMgF9fSMTs+hGe6vtZo eNQKv5EseaHjG4+S00WmrmKyZ6BfjMAyktaRQf6wHOgOs1IdEBWJKILpLRKFyqsZaweJ QzCb12Mk8Nbfg/ujxJSHsIfvCY3Cdx4WXcOajJ9hi3ZtsIH5xuBE7pL7yuSd6fm5zJEL F20g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y7JniS282f7kpZ2OXZXS7NrcHTFngjSUBwWhD/gNs5E=; b=ScOVdVcebp90D39ERHRa6PQLmB7F/CTKIER8dQjUnn5BfiIMx8Cqs4FrphLhMsMudw DkoGjpY7V/3yRE8FzbKkkbQOfZx9Vhf/FmXgzRLRyIO53oN44pnMr0bHa+3Vxj2fAKuk /UOLGcn1LvLp+B25VQ9DAAXTx9c9Xf0uUuNq/0Q40pcpdC72CHfDvId9IbMPFXJ0Ghn0 3oEiMxmYo/s8/ovR2282zXR6GBHc/CelPmkZ2PSKm4/utjMyhVVgDYLibYs99/S4CaEY a0zzxUjVvvV9tm6DTCKjWwtt6RXIJAGxe6EwSISZD9c0uPrK4Wb10iGxzBQv7DfBMIvt SfSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o8lKTN04; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si14537593ejw.362.2021.03.16.06.00.47; Tue, 16 Mar 2021 06:01:11 -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=@gmail.com header.s=20161025 header.b=o8lKTN04; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235702AbhCPFsl (ORCPT + 99 others); Tue, 16 Mar 2021 01:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235604AbhCPFsD (ORCPT ); Tue, 16 Mar 2021 01:48:03 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5D5BC06174A; Mon, 15 Mar 2021 22:48:02 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id a22-20020a17090aa516b02900c1215e9b33so768075pjq.5; Mon, 15 Mar 2021 22:48:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y7JniS282f7kpZ2OXZXS7NrcHTFngjSUBwWhD/gNs5E=; b=o8lKTN04BZ94LjuNDIH8DU0oDOV21ta6CbwyNZSvTEdwsvgN9jKLbWAZsuax14aW3c /uG5rk9bVeEjoIz0uHjqghio/y1Rx1JTa5eMe8oARTf0T4OY9OCwgoAe8zPk4UBEV2Nf IWyQYuKcpG/lrFNkdQ9vc0CnRNPJEwdi9C+WR6sI2FAidUr1cEJLvNpPeCwLSXR2Vi5M v//iC/+/uSI4lAUCLyHtOVuWfNHFv/dOIijGF/Di0EXISHHobOW8LMzfBLYatBPuIXbr OI7Cxv5TbXe2/MWZqYUTWv/HWjkapxwXtpHapuKHomAKPeoksB1ptwcQdAYydD+fP5lk o5yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y7JniS282f7kpZ2OXZXS7NrcHTFngjSUBwWhD/gNs5E=; b=e0f+8lgDEYlMZ9IfbrCfSO0wNaGRFRBCskdkzRabguJW2aKcQKqv/vSyvwhfSxfEV6 kr96uAue2TYoPXsujo+p8/FXa4aEoSAWvYvMJvGIUizvlM9OyVpKxu7jOBJrCG7Vc00/ MAWrnz4jV5QVVZg1WrnexXy4of6LUKFNRel5TvtJ1tmeJ9be+bzp04eXIQIUpP4J8YIm t+LkHrueBq3B7eiMyCVvqgiUsFLvXQ4NHVuBuXbGmOeIEbz0GNBYXE+7fc0VqtimZ5kb WCdF7VQV/9kIv/lKeLgIfDxnVH0RVo7NbyQssevcvZdn6JHSdvUfoHL1u7mQOolUB4WR ixng== X-Gm-Message-State: AOAM533VoOZzXWnaYoGjlM8EbEbs21HglBCIMFUuHr7KHOqE1tEkz7Jn VruVFVgaQ4NSmG1ZryxOpoU= X-Received: by 2002:a17:902:26c:b029:e6:648f:2668 with SMTP id 99-20020a170902026cb02900e6648f2668mr15114228plc.66.1615873682436; Mon, 15 Mar 2021 22:48:02 -0700 (PDT) Received: from cl-arch-kdev.. (cl-arch-kdev.xen.prgmr.com. [2605:2700:0:2:a800:ff:fed6:fc0d]) by smtp.gmail.com with ESMTPSA id l22sm15096513pfd.145.2021.03.15.22.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 22:48:02 -0700 (PDT) From: Fox Chen To: neilb@suse.de Cc: Fox Chen , corbet@lwn.net, vegard.nossum@oracle.com, viro@zeniv.linux.org.uk, rdunlap@infradead.org, grandmaster@al2klimov.de, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v2 12/12] docs: path-lookup: update symlink description Date: Tue, 16 Mar 2021 13:47:27 +0800 Message-Id: <20210316054727.25655-13-foxhlchen@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210316054727.25655-1-foxhlchen@gmail.com> References: <20210316054727.25655-1-foxhlchen@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org instead of lookup_real()/vfs_create(), i_op->lookup() and i_op->create() will be called directly. update vfs_open() logic should_follow_link is merged into lookup_last() or open_last_lookup() which returns symlink name instead of an integer. Signed-off-by: Fox Chen --- Documentation/filesystems/path-lookup.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Documentation/filesystems/path-lookup.rst b/Documentation/filesystems/path-lookup.rst index eef6e9f68fba..adbc714740c2 100644 --- a/Documentation/filesystems/path-lookup.rst +++ b/Documentation/filesystems/path-lookup.rst @@ -1202,16 +1202,15 @@ the code. it. If the file was found in the dcache, then ``vfs_open()`` is used for this. If not, then ``lookup_open()`` will either call ``atomic_open()`` (if the filesystem provides it) to combine the final lookup with the open, or - will perform the separate ``lookup_real()`` and ``vfs_create()`` steps + will perform the separate ``i_op->lookup()`` and ``i_op->create()`` steps directly. In the later case the actual "open" of this newly found or created file will be performed by ``vfs_open()``, just as if the name were found in the dcache. 2. ``vfs_open()`` can fail with ``-EOPENSTALE`` if the cached information - wasn't quite current enough. Rather than restarting the lookup from - the top with ``LOOKUP_REVAL`` set, ``lookup_open()`` is called instead, - giving the filesystem a chance to resolve small inconsistencies. - If that doesn't work, only then is the lookup restarted from the top. + wasn't quite current enough. If it's in RCU-walk -ECHILD will be returned + otherwise will return -ESTALE. When -ESTALE is returned, the caller may + retry with LOOKUP_REVAL flag set. 3. An open with O_CREAT **does** follow a symlink in the final component, unlike other creation system calls (like ``mkdir``). So the sequence:: @@ -1221,8 +1220,8 @@ the code. will create a file called ``/tmp/bar``. This is not permitted if ``O_EXCL`` is set but otherwise is handled for an O_CREAT open much - like for a non-creating open: ``should_follow_link()`` returns ``1``, and - so does ``do_last()`` so that ``trailing_symlink()`` gets called and the + like for a non-creating open: ``lookup_last()`` or ``open_last_lookup()`` + returns a non ``Null`` value, and ``link_path_walk()`` gets called and the open process continues on the symlink that was found. Updating the access time -- 2.30.2