* [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories
@ 2025-11-13 9:53 Mauro Carvalho Chehab
2025-11-13 16:21 ` Jonathan Corbet
2025-11-13 19:39 ` Randy Dunlap
0 siblings, 2 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2025-11-13 9:53 UTC (permalink / raw)
To: Linux Doc Mailing List, Jonathan Corbet
Cc: Mauro Carvalho Chehab, linux-kernel, Randy Dunlap
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@infradead.org>
Closes: https://lore.kernel.org/linux-doc/80701524-09fd-4d68-8715-331f47c969f2@infradead.org/
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
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():
--
2.51.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories
2025-11-13 9:53 [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories Mauro Carvalho Chehab
@ 2025-11-13 16:21 ` Jonathan Corbet
2025-11-13 17:08 ` Mauro Carvalho Chehab
2025-11-13 19:39 ` Randy Dunlap
1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2025-11-13 16:21 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Linux Doc Mailing List
Cc: Mauro Carvalho Chehab, linux-kernel, Randy Dunlap
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:
> 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@infradead.org>
> Closes: https://lore.kernel.org/linux-doc/80701524-09fd-4d68-8715-331f47c969f2@infradead.org/
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This looks the same as yesterday's version?
Applied, anyway, thanks.
jon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories
2025-11-13 16:21 ` Jonathan Corbet
@ 2025-11-13 17:08 ` Mauro Carvalho Chehab
2025-11-13 19:50 ` Randy Dunlap
0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2025-11-13 17:08 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Mauro Carvalho Chehab, Linux Doc Mailing List, linux-kernel,
Randy Dunlap
On Thu, Nov 13, 2025 at 09:21:26AM -0700, Jonathan Corbet wrote:
> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:
>
> > 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@infradead.org>
> > Closes: https://lore.kernel.org/linux-doc/80701524-09fd-4d68-8715-331f47c969f2@infradead.org/
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
>
> This looks the same as yesterday's version?
I haven't changed it (but I was assuming yesterday's version was not sent). I had some bugs related to smtp proxy at the office....
>
> Applied, anyway, thanks.
Thanks!
>
> jon
--
Thanks,
Mauro
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories
2025-11-13 9:53 [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories Mauro Carvalho Chehab
2025-11-13 16:21 ` Jonathan Corbet
@ 2025-11-13 19:39 ` Randy Dunlap
1 sibling, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2025-11-13 19:39 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Linux Doc Mailing List, Jonathan Corbet
Cc: linux-kernel
On 11/13/25 1:53 AM, Mauro Carvalho Chehab wrote:
> 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@infradead.org>
> Closes: https://lore.kernel.org/linux-doc/80701524-09fd-4d68-8715-331f47c969f2@infradead.org/
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
(again...(
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories
2025-11-13 17:08 ` Mauro Carvalho Chehab
@ 2025-11-13 19:50 ` Randy Dunlap
0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2025-11-13 19:50 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Jonathan Corbet
Cc: Linux Doc Mailing List, linux-kernel
On 11/13/25 9:08 AM, Mauro Carvalho Chehab wrote:
> On Thu, Nov 13, 2025 at 09:21:26AM -0700, Jonathan Corbet wrote:
>> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> writes:
>>
>>> 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@infradead.org>
>>> Closes: https://lore.kernel.org/linux-doc/80701524-09fd-4d68-8715-331f47c969f2@infradead.org/
>>> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
>>
>> This looks the same as yesterday's version?
>
> I haven't changed it (but I was assuming yesterday's version was not sent). I had some bugs related to smtp proxy at the office....
That would be the one that I replied to that was missing a Subject: line
according to my mail client:
https://lore.kernel.org/linux-doc/20251112171452.Y5jX9%25mchehab+huawei@kernel.org/
(actually there were several like that)
--
~Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-11-13 19:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-13 9:53 [PATCH] scripts: docs: kdoc_files.py: don't consider symlinks as directories Mauro Carvalho Chehab
2025-11-13 16:21 ` Jonathan Corbet
2025-11-13 17:08 ` Mauro Carvalho Chehab
2025-11-13 19:50 ` Randy Dunlap
2025-11-13 19:39 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®