Skip to content

Commit 0f4a2ce

Browse files
author
Al Viro
committed
do_dentry_open(): kill inode argument
should've been done as soon as overlayfs stopped messing with fake paths... Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent af58dc1 commit 0f4a2ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/open.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,10 +902,10 @@ static inline int file_get_write_access(struct file *f)
902902
}
903903

904904
static int do_dentry_open(struct file *f,
905-
struct inode *inode,
906905
int (*open)(struct inode *, struct file *))
907906
{
908907
static const struct file_operations empty_fops = {};
908+
struct inode *inode = f->f_path.dentry->d_inode;
909909
int error;
910910

911911
path_get(&f->f_path);
@@ -1047,7 +1047,7 @@ int finish_open(struct file *file, struct dentry *dentry,
10471047
BUG_ON(file->f_mode & FMODE_OPENED); /* once it's opened, it's opened */
10481048

10491049
file->f_path.dentry = dentry;
1050-
return do_dentry_open(file, d_backing_inode(dentry), open);
1050+
return do_dentry_open(file, open);
10511051
}
10521052
EXPORT_SYMBOL(finish_open);
10531053

@@ -1086,7 +1086,7 @@ EXPORT_SYMBOL(file_path);
10861086
int vfs_open(const struct path *path, struct file *file)
10871087
{
10881088
file->f_path = *path;
1089-
return do_dentry_open(file, d_backing_inode(path->dentry), NULL);
1089+
return do_dentry_open(file, NULL);
10901090
}
10911091

10921092
struct file *dentry_open(const struct path *path, int flags,
@@ -1174,7 +1174,7 @@ struct file *kernel_file_open(const struct path *path, int flags,
11741174
return f;
11751175

11761176
f->f_path = *path;
1177-
error = do_dentry_open(f, d_inode(path->dentry), NULL);
1177+
error = do_dentry_open(f, NULL);
11781178
if (error) {
11791179
fput(f);
11801180
f = ERR_PTR(error);

0 commit comments

Comments
 (0)