Commit 2e2cbaf9 authored by Al Viro's avatar Al Viro

fix hostfs_open() use of ->f_path.dentry

this is one of the cases where we need to use d_real() - we are
using more than the name of dentry here.  ->d_sb is used as well,
so in case of hostfs being used as a layer we get the wrong
superblock.
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Tested-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 1a97d899
......@@ -315,7 +315,7 @@ static int hostfs_open(struct inode *ino, struct file *file)
if (mode & FMODE_WRITE)
r = w = 1;
name = dentry_name(file->f_path.dentry);
name = dentry_name(d_real(file->f_path.dentry, file->f_inode));
if (name == NULL)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment