Skip to content

Commit 952923d

Browse files
committed
Merge tag 'pull-18-rc1-work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pathname updates from Al Viro: "Several cleanups in fs/namei.c" * tag 'pull-18-rc1-work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: namei: cleanup double word in comment get rid of dead code in legitimize_root() fs/namei.c:reserve_stack(): tidy up the call of try_to_unlazy()
2 parents cbd76ed + 30476f7 commit 952923d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

fs/namei.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,6 @@ static bool legitimize_links(struct nameidata *nd)
730730

731731
static bool legitimize_root(struct nameidata *nd)
732732
{
733-
/*
734-
* For scoped-lookups (where nd->root has been zeroed), we need to
735-
* restart the whole lookup from scratch -- because set_root() is wrong
736-
* for these lookups (nd->dfd is the root, not the filesystem root).
737-
*/
738-
if (!nd->root.mnt && (nd->flags & LOOKUP_IS_SCOPED))
739-
return false;
740733
/* Nothing to do if nd->root is zero or is managed by the VFS user. */
741734
if (!nd->root.mnt || (nd->state & ND_ROOT_PRESET))
742735
return true;
@@ -798,7 +791,7 @@ static bool try_to_unlazy(struct nameidata *nd)
798791
* @seq: seq number to check @dentry against
799792
* Returns: true on success, false on failure
800793
*
801-
* Similar to to try_to_unlazy(), but here we have the next dentry already
794+
* Similar to try_to_unlazy(), but here we have the next dentry already
802795
* picked by rcu-walk and want to legitimize that in addition to the current
803796
* nd->path and nd->root for ref-walk mode. Must be called from rcu-walk context.
804797
* Nothing should touch nameidata between try_to_unlazy_next() failure and
@@ -1755,7 +1748,7 @@ static int reserve_stack(struct nameidata *nd, struct path *link, unsigned seq)
17551748
// unlazy even if we fail to grab the link - cleanup needs it
17561749
bool grabbed_link = legitimize_path(nd, link, seq);
17571750

1758-
if (!try_to_unlazy(nd) != 0 || !grabbed_link)
1751+
if (!try_to_unlazy(nd) || !grabbed_link)
17591752
return -ECHILD;
17601753

17611754
if (nd_alloc_stack(nd))

0 commit comments

Comments
 (0)