Loading fs/namei.c +13 −17 Original line number Original line Diff line number Diff line Loading @@ -1821,9 +1821,8 @@ struct file *do_filp_open(int dfd, const char *pathname, nd.flags |= LOOKUP_REVAL; nd.flags |= LOOKUP_REVAL; error = path_walk(pathname, &nd); error = path_walk(pathname, &nd); if (error) { if (error) { if (nd.root.mnt) filp = ERR_PTR(error); path_put(&nd.root); goto out; return ERR_PTR(error); } } if (unlikely(!audit_dummy_context())) if (unlikely(!audit_dummy_context())) audit_inode(pathname, nd.path.dentry); audit_inode(pathname, nd.path.dentry); Loading @@ -1847,9 +1846,7 @@ struct file *do_filp_open(int dfd, const char *pathname, filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); if (!filp) if (!filp) goto do_link; goto do_link; if (nd.root.mnt) goto out; path_put(&nd.root); return filp; exit_dput: exit_dput: path_put_conditional(&path, &nd); path_put_conditional(&path, &nd); Loading @@ -1857,9 +1854,15 @@ struct file *do_filp_open(int dfd, const char *pathname, release_open_intent(&nd); release_open_intent(&nd); exit_parent: exit_parent: path_put(&nd.path); path_put(&nd.path); filp = ERR_PTR(error); out: if (nd.root.mnt) if (nd.root.mnt) path_put(&nd.root); path_put(&nd.root); return ERR_PTR(error); if (filp == ERR_PTR(-ESTALE) && !force_reval) { force_reval = 1; goto reval; } return filp; do_link: do_link: error = -ELOOP; error = -ELOOP; Loading Loading @@ -1887,13 +1890,8 @@ struct file *do_filp_open(int dfd, const char *pathname, * with "intent.open". * with "intent.open". */ */ release_open_intent(&nd); release_open_intent(&nd); if (nd.root.mnt) filp = ERR_PTR(error); path_put(&nd.root); goto out; if (error == -ESTALE && !force_reval) { force_reval = 1; goto reval; } return ERR_PTR(error); } } nd.flags &= ~LOOKUP_PARENT; nd.flags &= ~LOOKUP_PARENT; filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); Loading @@ -1901,9 +1899,7 @@ struct file *do_filp_open(int dfd, const char *pathname, __putname(nd.last.name); __putname(nd.last.name); if (!filp) if (!filp) goto do_link; goto do_link; if (nd.root.mnt) goto out; path_put(&nd.root); return filp; } } /** /** Loading Loading
fs/namei.c +13 −17 Original line number Original line Diff line number Diff line Loading @@ -1821,9 +1821,8 @@ struct file *do_filp_open(int dfd, const char *pathname, nd.flags |= LOOKUP_REVAL; nd.flags |= LOOKUP_REVAL; error = path_walk(pathname, &nd); error = path_walk(pathname, &nd); if (error) { if (error) { if (nd.root.mnt) filp = ERR_PTR(error); path_put(&nd.root); goto out; return ERR_PTR(error); } } if (unlikely(!audit_dummy_context())) if (unlikely(!audit_dummy_context())) audit_inode(pathname, nd.path.dentry); audit_inode(pathname, nd.path.dentry); Loading @@ -1847,9 +1846,7 @@ struct file *do_filp_open(int dfd, const char *pathname, filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); if (!filp) if (!filp) goto do_link; goto do_link; if (nd.root.mnt) goto out; path_put(&nd.root); return filp; exit_dput: exit_dput: path_put_conditional(&path, &nd); path_put_conditional(&path, &nd); Loading @@ -1857,9 +1854,15 @@ struct file *do_filp_open(int dfd, const char *pathname, release_open_intent(&nd); release_open_intent(&nd); exit_parent: exit_parent: path_put(&nd.path); path_put(&nd.path); filp = ERR_PTR(error); out: if (nd.root.mnt) if (nd.root.mnt) path_put(&nd.root); path_put(&nd.root); return ERR_PTR(error); if (filp == ERR_PTR(-ESTALE) && !force_reval) { force_reval = 1; goto reval; } return filp; do_link: do_link: error = -ELOOP; error = -ELOOP; Loading Loading @@ -1887,13 +1890,8 @@ struct file *do_filp_open(int dfd, const char *pathname, * with "intent.open". * with "intent.open". */ */ release_open_intent(&nd); release_open_intent(&nd); if (nd.root.mnt) filp = ERR_PTR(error); path_put(&nd.root); goto out; if (error == -ESTALE && !force_reval) { force_reval = 1; goto reval; } return ERR_PTR(error); } } nd.flags &= ~LOOKUP_PARENT; nd.flags &= ~LOOKUP_PARENT; filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); Loading @@ -1901,9 +1899,7 @@ struct file *do_filp_open(int dfd, const char *pathname, __putname(nd.last.name); __putname(nd.last.name); if (!filp) if (!filp) goto do_link; goto do_link; if (nd.root.mnt) goto out; path_put(&nd.root); return filp; } } /** /** Loading