Skip to content

Commit

Permalink
postpone __putname() until after do_last()
Browse files Browse the repository at this point in the history
Since do_last() doesn't mangle nd->last_name, we can safely postpone
__putname() done in handling of trailing symlinks until after the
call of do_last()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 5, 2010
1 parent 27bff34 commit c41c140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1923,9 +1923,9 @@ struct file *do_filp_open(int dfd, const char *pathname,
mutex_lock(&dir->d_inode->i_mutex);
path.dentry = lookup_hash(&nd);
path.mnt = nd.path.mnt;
__putname(nd.last.name);
filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode,
pathname, dir, &is_link);
__putname(nd.last.name);
if (is_link)
goto do_link;
if (nd.root.mnt)
Expand Down

0 comments on commit c41c140

Please sign in to comment.