fs: only assert on LOOKUP_RCU when built with CONFIG_DEBUG_VFS

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>
This commit is contained in:
Mateusz Guzik 2025-12-29 13:57:51 +01:00 committed by Christian Brauner
parent 0f166bf1d6
commit 729d015ab2
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View 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 @@ static bool try_to_unlazy(struct nameidata *nd)
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;