[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1a1b0c88-e610-4851-a01d-ff16d472cb6f@infradead.org>
Date: Wed, 12 Nov 2025 17:31:33 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: mchehab+huawei@...nel.org, linux-doc@...r.kernel.org, corbet@....net,
linux-kernel@...r.kernel.org
Subject: Re: PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as
directories
[all of my copies of this email had header (at least Subject:) problems]
On 11/12/25 9:14 AM, mchehab+huawei@...nel.org wrote:
> From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> To: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
> Jonathan Corbet <corbet@....net>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
> linux-kernel@...r.kernel.org,
> Randy Dunlap <rdunlap@...radead.org>
> Subject: [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories
> Date: Wed, 12 Nov 2025 18:14:49 +0100
> Message-ID: <73c3450f34e2a4b42ef2ef279d7487c47d22e3bd.1762967688.git.mchehab+huawei@...nel.org>
> X-Mailer: git-send-email 2.51.1
> MIME-Version: 1.0
> Content-Transfer-Encoding: 8bit
>
> As reported by Randy, currently kdoc_files can go into endless
> looks when symlinks are used:
>
> $ ln -s . Documentation/peci/foo
> $ ./scripts/kernel-doc Documentation/peci/
> ...
> File "/new_devel/docs/scripts/lib/kdoc/kdoc_files.py", line 52, in _parse_dir
> if entry.is_dir():
> ~~~~~~~~~~~~^^
> OSError: [Errno 40] Too many levels of symbolic links: 'Documentation/peci/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo/foo'
>
> Prevent that by not considering symlinks as directories.
>
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
> Closes: https://lore.kernel.org/linux-doc/80701524-09fd-4d68-8715-331f47c969f2@infradead.org/
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Reviewed-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org>
Thanks.
> ---
> scripts/lib/kdoc/kdoc_files.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/lib/kdoc/kdoc_files.py b/scripts/lib/kdoc/kdoc_files.py
> index 061c033f32da..1fd8d17edb32 100644
> --- a/scripts/lib/kdoc/kdoc_files.py
> +++ b/scripts/lib/kdoc/kdoc_files.py
> @@ -49,7 +49,7 @@ class GlobSourceFiles:
> for entry in obj:
> name = os.path.join(dirname, entry.name)
>
> - if entry.is_dir():
> + if entry.is_dir(follow_symlinks=False):
> yield from self._parse_dir(name)
>
> if not entry.is_file():
--
~Randy
Powered by blists - more mailing lists