linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups
@ 2023-10-23 18:47 Bernd Schubert
  2023-10-24  9:00 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Schubert @ 2023-10-23 18:47 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: bernd.schubert, Bernd Schubert, Christian Brauner, Al Viro,
	Amir Goldstein, Dharmendra Singh, Miklos Szeredi

The calling code actually handles -ECHILD, so this BUG_ON
can be converted to WARN_ON_ONCE.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Dharmendra Singh <dsingh@ddn.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org

---
This relates to the fuse atomic open patches and their vfs revalidate
part. Amir had annotated that these patches had a BUG_ON, which I had
only taken as a few lines below the there was the BUG_ON replaced in
this patch.
---
 fs/namei.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index 94565bd7e73f..9ff8590ea0a7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3536,7 +3536,8 @@ static const char *open_last_lookups(struct nameidata *nd,
 		if (likely(dentry))
 			goto finish_lookup;
 
-		BUG_ON(nd->flags & LOOKUP_RCU);
+		if (WARN_ON_ONCE(nd->flags & LOOKUP_RCU))
+			return ERR_PTR(-ECHILD);
 	} else {
 		/* create side of things */
 		if (nd->flags & LOOKUP_RCU) {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [RFC] vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups
  2023-10-23 18:47 [PATCH] [RFC] vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups Bernd Schubert
@ 2023-10-24  9:00 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2023-10-24  9:00 UTC (permalink / raw)
  To: Bernd Schubert
  Cc: Christian Brauner, bernd.schubert, Al Viro, Amir Goldstein,
	Dharmendra Singh, Miklos Szeredi, linux-fsdevel

On Mon, 23 Oct 2023 20:47:18 +0200, Bernd Schubert wrote:
> The calling code actually handles -ECHILD, so this BUG_ON
> can be converted to WARN_ON_ONCE.
> 
> 

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/1] vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups
      https://git.kernel.org/vfs/vfs/c/c04d905f6c7c

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-24  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 18:47 [PATCH] [RFC] vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups Bernd Schubert
2023-10-24  9:00 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).