From: Mateusz Guzik Date: Mon, 29 Dec 2025 12:57:51 +0000 (+0100) Subject: fs: only assert on LOOKUP_RCU when built with CONFIG_DEBUG_VFS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=729d015ab230d1d6debd69744c6e0fb70c16a779;p=thirdparty%2Flinux.git 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 Link: https://patch.msgid.link/20251229125751.826050-1-mjguzik@gmail.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/fs/namei.c b/fs/namei.c index bf0f66f0e9b92..280c69e8fb991 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -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;