Skip to content

Commit

Permalink
do_dentry_open(): kill inode argument
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Apr 15, 2024
1 parent af58dc1 commit 0f4a2ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,10 +902,10 @@ static inline int file_get_write_access(struct file *f)
}

static int do_dentry_open(struct file *f,
struct inode *inode,
int (*open)(struct inode *, struct file *))
{
static const struct file_operations empty_fops = {};
struct inode *inode = f->f_path.dentry->d_inode;
int error;

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

file->f_path.dentry = dentry;
return do_dentry_open(file, d_backing_inode(dentry), open);
return do_dentry_open(file, open);
}
EXPORT_SYMBOL(finish_open);

Expand Down Expand Up @@ -1086,7 +1086,7 @@ EXPORT_SYMBOL(file_path);
int vfs_open(const struct path *path, struct file *file)
{
file->f_path = *path;
return do_dentry_open(file, d_backing_inode(path->dentry), NULL);
return do_dentry_open(file, NULL);
}

struct file *dentry_open(const struct path *path, int flags,
Expand Down Expand Up @@ -1174,7 +1174,7 @@ struct file *kernel_file_open(const struct path *path, int flags,
return f;

f->f_path = *path;
error = do_dentry_open(f, d_inode(path->dentry), NULL);
error = do_dentry_open(f, NULL);
if (error) {
fput(f);
f = ERR_PTR(error);
Expand Down

0 comments on commit 0f4a2ce

Please sign in to comment.