public inbox for linux-fsdevel@vger.kernel.org
 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

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