]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: only assert on LOOKUP_RCU when built with CONFIG_DEBUG_VFS
authorMateusz Guzik <mjguzik@gmail.com>
Mon, 29 Dec 2025 12:57:51 +0000 (13:57 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 6 Jan 2026 21:47:07 +0000 (22:47 +0100)
Calls to the 2 modified routines are explicitly gated with checks for
the flag, so there is no use for this in production kernels.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20251229125751.826050-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namei.c

index bf0f66f0e9b92c106fc92759d22f8158187c29d1..280c69e8fb991ac10e2eec534f01795729c1d9ff 100644 (file)
@@ -881,7 +881,7 @@ static bool try_to_unlazy(struct nameidata *nd)
 {
        struct dentry *parent = nd->path.dentry;
 
-       BUG_ON(!(nd->flags & LOOKUP_RCU));
+       VFS_BUG_ON(!(nd->flags & LOOKUP_RCU));
 
        if (unlikely(nd->depth && !legitimize_links(nd)))
                goto out1;
@@ -916,7 +916,8 @@ out:
 static bool try_to_unlazy_next(struct nameidata *nd, struct dentry *dentry)
 {
        int res;
-       BUG_ON(!(nd->flags & LOOKUP_RCU));
+
+       VFS_BUG_ON(!(nd->flags & LOOKUP_RCU));
 
        if (unlikely(nd->depth && !legitimize_links(nd)))
                goto out2;