All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.kernel.org
Cc: Christian Brauner <christian@brauner.io>
Subject: [PATCH 5/6] do_dentry_open(): kill inode argument
Date: Sat, 6 Apr 2024 06:01:56 +0100	[thread overview]
Message-ID: <20240406050156.GE1632446@ZenIV> (raw)
In-Reply-To: <20240406045622.GY538574@ZenIV>

should've been done as soon as overlayfs stopped messing with fake
paths...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/open.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index ec287ac67e7f..89cafb572061 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -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);
@@ -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);
 
@@ -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,
@@ -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);
-- 
2.39.2


  parent reply	other threads:[~2024-04-06  5:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06  4:56 [PATCHES] misc stuff that should've been pushed in the last window Al Viro
2024-04-06  4:57 ` [PATCH 1/6] close_on_exec(): pass files_struct instead of fdtable Al Viro
2024-04-09  9:21   ` Christian Brauner
2024-04-06  4:57 ` [PATCH 2/6] fd_is_open(): move to fs/file.c Al Viro
2024-04-09  9:21   ` Christian Brauner
2024-04-06  5:00 ` [PATCH 3/6] get_file_rcu(): no need to check for NULL separately Al Viro
2024-04-09  9:23   ` Christian Brauner
2024-04-06  5:01 ` [PATCH 4/6] kernel_file_open(): get rid of inode argument Al Viro
2024-04-09  9:24   ` Christian Brauner
2024-04-06  5:01 ` Al Viro [this message]
2024-04-09  9:25   ` [PATCH 5/6] do_dentry_open(): kill " Christian Brauner
2024-04-06  5:02 ` [PATCH 6/6] remove call_{read,write}_iter() functions Al Viro
2024-04-09  9:26   ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240406050156.GE1632446@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=christian@brauner.io \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.