提交 3899167d 编写于 作者: A Al Viro

Get rid of mnt_mountpoint abuses in ext4

path to mnt/mnt->mnt_root is no worse than that to
mnt->mnt_parent/mnt->mnt_mountpoint *and* needs no
pinning the sucker down (mnt is not going away and
mnt->mnt_root won't change)
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 f598f9f1
...@@ -116,11 +116,9 @@ static int ext4_file_open(struct inode * inode, struct file * filp) ...@@ -116,11 +116,9 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
* devices or filesystem images. * devices or filesystem images.
*/ */
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
path.mnt = mnt->mnt_parent; path.mnt = mnt;
path.dentry = mnt->mnt_mountpoint; path.dentry = mnt->mnt_root;
path_get(&path);
cp = d_path(&path, buf, sizeof(buf)); cp = d_path(&path, buf, sizeof(buf));
path_put(&path);
if (!IS_ERR(cp)) { if (!IS_ERR(cp)) {
memcpy(sbi->s_es->s_last_mounted, cp, memcpy(sbi->s_es->s_last_mounted, cp,
sizeof(sbi->s_es->s_last_mounted)); sizeof(sbi->s_es->s_last_mounted));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册