Skip to content

Commit ef4aa53

Browse files
foxhlchenJonathan Corbet
authored andcommitted
docs: path-lookup: update symlink description
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 <[email protected]> Reviewed-by: NeilBrown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 3c1be84 commit ef4aa53

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Documentation/filesystems/path-lookup.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,16 +1200,15 @@ the code.
12001200
it. If the file was found in the dcache, then ``vfs_open()`` is used for
12011201
this. If not, then ``lookup_open()`` will either call ``atomic_open()`` (if
12021202
the filesystem provides it) to combine the final lookup with the open, or
1203-
will perform the separate ``lookup_real()`` and ``vfs_create()`` steps
1203+
will perform the separate ``i_op->lookup()`` and ``i_op->create()`` steps
12041204
directly. In the later case the actual "open" of this newly found or
12051205
created file will be performed by ``vfs_open()``, just as if the name
12061206
were found in the dcache.
12071207

12081208
2. ``vfs_open()`` can fail with ``-EOPENSTALE`` if the cached information
1209-
wasn't quite current enough. Rather than restarting the lookup from
1210-
the top with ``LOOKUP_REVAL`` set, ``lookup_open()`` is called instead,
1211-
giving the filesystem a chance to resolve small inconsistencies.
1212-
If that doesn't work, only then is the lookup restarted from the top.
1209+
wasn't quite current enough. If it's in RCU-walk ``-ECHILD`` will be returned
1210+
otherwise ``-ESTALE`` is returned. When ``-ESTALE`` is returned, the caller may
1211+
retry with ``LOOKUP_REVAL`` flag set.
12131212

12141213
3. An open with O_CREAT **does** follow a symlink in the final component,
12151214
unlike other creation system calls (like ``mkdir``). So the sequence::
@@ -1219,8 +1218,8 @@ the code.
12191218

12201219
will create a file called ``/tmp/bar``. This is not permitted if
12211220
``O_EXCL`` is set but otherwise is handled for an O_CREAT open much
1222-
like for a non-creating open: ``should_follow_link()`` returns ``1``, and
1223-
so does ``do_last()`` so that ``trailing_symlink()`` gets called and the
1221+
like for a non-creating open: ``lookup_last()`` or ``open_last_lookup()``
1222+
returns a non ``NULL`` value, and ``link_path_walk()`` gets called and the
12241223
open process continues on the symlink that was found.
12251224

12261225
Updating the access time

0 commit comments

Comments
 (0)