[PATCH] [RFC] vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Bernd Schubert <bschubert@xxxxxxx>
Cc: Christian Brauner <brauner@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Amir Goldstein <amir73il@xxxxxxxxx>
Cc: Dharmendra Singh <dsingh@xxxxxxx>
Cc: Miklos Szeredi <miklos@xxxxxxxxxx>
Cc: linux-fsdevel@xxxxxxxxxxxxxxx

---
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





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux