From: Christian Brauner <brauner@kernel.org>
To: NeilBrown <neil@brown.name>
Cc: linux-fsdevel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jan Kara <jack@suse.cz>, Jori Koolstra <jkoolstra@xs4all.nl>,
linux-kernel@vger.kernel.org,
"Christian Brauner (Amutable)" <brauner@kernel.org>
Subject: [PATCH 3/3] fs/namei.c: fix coding style in atomic_open() and lookup_open()
Date: Fri, 31 Jul 2026 10:36:07 +0200 [thread overview]
Message-ID: <20260731-work-lookup-fixes-v1-3-2412b85cf65c@kernel.org> (raw)
In-Reply-To: <20260731-work-lookup-fixes-v1-0-2412b85cf65c@kernel.org>
Commit 4886c80eef20 ("vfs: call audit_inode_child() in lookup_open() on
failure") indented a continuation line with spaces, left three
declarations without a following blank line and used a trailing */ on the
last line of a block comment. Clean all of that up, no functional change.
Fixes: 4886c80eef20 ("vfs: call audit_inode_child() in lookup_open() on failure")
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
fs/namei.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index e31905dfeb20..c0da9b5dd47a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4377,6 +4377,7 @@ static struct dentry *atomic_open(const struct path *path, struct dentry *dentry
if (file->f_mode & FMODE_OPENED) {
/* finish_open() called */
struct dentry *opened = file->f_path.dentry;
+
if (unlikely(opened != dentry)) {
dput(dentry);
dentry = dget(opened);
@@ -4384,6 +4385,7 @@ static struct dentry *atomic_open(const struct path *path, struct dentry *dentry
} else if (likely(file->f_path.dentry != DENTRY_NOT_SET)) {
/* finish_no_open() called */
struct dentry *replaced = file->f_path.dentry;
+
if (replaced) {
dput(dentry);
dentry = replaced;
@@ -4392,8 +4394,9 @@ static struct dentry *atomic_open(const struct path *path, struct dentry *dentry
error = -ENOENT;
} else {
const char *fsname = dentry->d_sb->s_type->name;
+
WARN(1, "%s: ->atomic_open() left file->f_path.dentry unset!\n",
- fsname);
+ fsname);
error = -EIO;
}
}
@@ -4540,8 +4543,10 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file,
}
}
if (dentry->d_inode || !(op->open_flag & O_CREAT)) {
- /* No need to create a file. If lookup returned a positive
- * dentry, the file will be opened in do_open(). */
+ /*
+ * No need to create a file. If lookup returned a positive
+ * dentry, the file will be opened in do_open().
+ */
goto out;
}
--
2.53.0
next prev parent reply other threads:[~2026-07-31 8:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 8:36 [PATCH 0/3] fs/namei.c: comment and coding style fixups Christian Brauner
2026-07-31 8:36 ` [PATCH 1/3] fs/namei.c: update stale comments in lookup_open() Christian Brauner
2026-07-31 8:36 ` [PATCH 2/3] fs/namei.c: fix kerneldoc of atomic_open() and vfs_lookup_open() Christian Brauner
2026-07-31 9:11 ` Jori Koolstra
2026-07-31 10:11 ` Christian Brauner
2026-07-31 8:36 ` Christian Brauner [this message]
2026-07-31 9:20 ` [PATCH 3/3] fs/namei.c: fix coding style in atomic_open() and lookup_open() Jori Koolstra
2026-07-31 10:01 ` Christian Brauner
2026-07-31 9:08 ` [PATCH 0/3] fs/namei.c: comment and coding style fixups NeilBrown
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=20260731-work-lookup-fixes-v1-3-2412b85cf65c@kernel.org \
--to=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=jkoolstra@xs4all.nl \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neil@brown.name \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®