Unverified Commit 729d015a authored by Mateusz Guzik's avatar Mateusz Guzik Committed by Christian Brauner
Browse files

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: default avatarMateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20251229125751.826050-1-mjguzik@gmail.com


Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 0f166bf1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;