mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
Several cleanups in fs/namei.c.
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQqUNBr3gm4hGXdBJlZ7Krx/gZQ6wUCYpvrrgAKCRBZ7Krx/gZQ 6+eZAP9r0c8E1UnUxRI32kQrzndJO2z9mKq6rI9D7GgJe+MtogEAlfynzklqbHzo fFvczeD0tzLu4aDExtGn6GNGf5gSpw4= =1blQ -----END PGP SIGNATURE----- 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()
This commit is contained in:
commit
952923ddc0
11
fs/namei.c
11
fs/namei.c
|
|
@ -730,13 +730,6 @@ static bool legitimize_links(struct nameidata *nd)
|
||||||
|
|
||||||
static bool legitimize_root(struct nameidata *nd)
|
static bool legitimize_root(struct nameidata *nd)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* For scoped-lookups (where nd->root has been zeroed), we need to
|
|
||||||
* restart the whole lookup from scratch -- because set_root() is wrong
|
|
||||||
* for these lookups (nd->dfd is the root, not the filesystem root).
|
|
||||||
*/
|
|
||||||
if (!nd->root.mnt && (nd->flags & LOOKUP_IS_SCOPED))
|
|
||||||
return false;
|
|
||||||
/* Nothing to do if nd->root is zero or is managed by the VFS user. */
|
/* Nothing to do if nd->root is zero or is managed by the VFS user. */
|
||||||
if (!nd->root.mnt || (nd->state & ND_ROOT_PRESET))
|
if (!nd->root.mnt || (nd->state & ND_ROOT_PRESET))
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -798,7 +791,7 @@ static bool try_to_unlazy(struct nameidata *nd)
|
||||||
* @seq: seq number to check @dentry against
|
* @seq: seq number to check @dentry against
|
||||||
* Returns: true on success, false on failure
|
* Returns: true on success, false on failure
|
||||||
*
|
*
|
||||||
* Similar to to try_to_unlazy(), but here we have the next dentry already
|
* Similar to try_to_unlazy(), but here we have the next dentry already
|
||||||
* picked by rcu-walk and want to legitimize that in addition to the current
|
* picked by rcu-walk and want to legitimize that in addition to the current
|
||||||
* nd->path and nd->root for ref-walk mode. Must be called from rcu-walk context.
|
* nd->path and nd->root for ref-walk mode. Must be called from rcu-walk context.
|
||||||
* Nothing should touch nameidata between try_to_unlazy_next() failure and
|
* 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)
|
||||||
// unlazy even if we fail to grab the link - cleanup needs it
|
// unlazy even if we fail to grab the link - cleanup needs it
|
||||||
bool grabbed_link = legitimize_path(nd, link, seq);
|
bool grabbed_link = legitimize_path(nd, link, seq);
|
||||||
|
|
||||||
if (!try_to_unlazy(nd) != 0 || !grabbed_link)
|
if (!try_to_unlazy(nd) || !grabbed_link)
|
||||||
return -ECHILD;
|
return -ECHILD;
|
||||||
|
|
||||||
if (nd_alloc_stack(nd))
|
if (nd_alloc_stack(nd))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user