[PATCH] fs/namespace.c: fix mountpath handling in do_lock_mount()
From: Ryan Chung
Date: Mon Aug 18 2025 - 13:23:01 EST
Updates documentation for do_lock_mount() in fs/namespace.c
to clarify its parameters and return description to fix
warning reported by syzbot.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202506301911.uysRaP8b-lkp@xxxxxxxxx/
Signed-off-by: Ryan Chung <seokwoo.chung130@xxxxxxxxx>
---
fs/namespace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index ddfd4457d338..577fdff9f1a8 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2741,6 +2741,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
/**
* do_lock_mount - lock mount and mountpoint
* @path: target path
+ * @pinned: on success, holds a pin guarding the mountpoint
* @beneath: whether the intention is to mount beneath @path
*
* Follow the mount stack on @path until the top mount @mnt is found. If
@@ -2769,8 +2770,7 @@ static int attach_recursive_mnt(struct mount *source_mnt,
* to @mnt->mnt_mp->m_dentry. But if @mnt has been unmounted it will
* point to @mnt->mnt_root and @mnt->mnt_mp will be NULL.
*
- * Return: Either the target mountpoint on the top mount or the top
- * mount's mountpoint.
+ * Return: On success, 0 is returned. On failure, err is returned.
*/
static int do_lock_mount(struct path *path, struct pinned_mountpoint *pinned, bool beneath)
{
--
2.43.0