[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8735ylhg3f.fsf@notabene.neil.brown.name>
Date: Thu, 28 Jan 2021 14:53:40 +1100
From: NeilBrown <neilb@...e.de>
To: Fox Chen <foxhlchen@...il.com>, corbet@....net,
vegard.nossum@...cle.com, viro@...iv.linux.org.uk,
rdunlap@...radead.org, grandmaster@...klimov.de
Cc: Fox Chen <foxhlchen@...il.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/12] docs: path-lookup: i_op->follow_link replaced
with i_op->get_link
On Tue, Jan 26 2021, Fox Chen wrote:
> follow_link has been replaced by get_link() which can be
> called in RCU mode.
>
> see commit: 6b2553918d8b4e6de9853fd6315bec7271a2e592
>
> Signed-off-by: Fox Chen <foxhlchen@...il.com>
> ---
> Documentation/filesystems/path-lookup.rst | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/filesystems/path-lookup.rst b/Documentation/filesystems/path-lookup.rst
> index 25d2a5a59f45..0a362849b26f 100644
> --- a/Documentation/filesystems/path-lookup.rst
> +++ b/Documentation/filesystems/path-lookup.rst
> @@ -1062,13 +1062,11 @@ filesystem cannot successfully get a reference in RCU-walk mode, it
> must return ``-ECHILD`` and ``unlazy_walk()`` will be called to return to
> REF-walk mode in which the filesystem is allowed to sleep.
>
> -The place for all this to happen is the ``i_op->follow_link()`` inode
> -method. In the present mainline code this is never actually called in
> -RCU-walk mode as the rewrite is not quite complete. It is likely that
> -in a future release this method will be passed an ``inode`` pointer when
> -called in RCU-walk mode so it both (1) knows to be careful, and (2) has the
> -validated pointer. Much like the ``i_op->permission()`` method we
> -looked at previously, ``->follow_link()`` would need to be careful that
> +The place for all this to happen is the ``i_op->get_link()`` inode
> +method. This is called both in RCU-walk and REF-walk. In RCU-walk the
> +``dentry*`` argument is NULL, ``->get_link()`` can return -ECHILD to drop
> +RCU-walk. Much like the ``i_op->permission()`` method we
The phrase "drop RCU-walk" isn't consistent with the rest of the text.
It talks about "dropping down to REF-walk", so you could write "dropping
out of RCU-walk", but not just "dropping RCU-walk".
NeilBrown
> +looked at previously, ``->get_link()`` would need to be careful that
> all the data structures it references are safe to be accessed while
> holding no counted reference, only the RCU lock. Though getting a
> reference with ``->follow_link()`` is not yet done in RCU-walk mode, the
> --
> 2.30.0
Download attachment "signature.asc" of type "application/pgp-signature" (854 bytes)
Powered by blists - more mailing lists