I ran into an interesting issue with plocate's updatedb when it was iterating through a Windows NTFS partition. Specifically, it turns out that in at least Windows 10, the directory (from Windows's POV): C:\Documents and Settings\Default User\Application Data has a junction to itself. updatedb (in Linux) was segfaulting from what looked to be a stack overflow due to what looked to be infinite traversal of that junction loop. The cause is that while stat() (and associated syscalls) correctly identify the junction as a symlink, readdir() (and associated syscalls) did not, reporting that it was a regular directory instead. I tried a similar setup in my root btrfs partition, and both stat() and readdir() reported the symlinks there as links, so it does look like an issue in ntfs3, or at least it's not consistent with other filesystems. This patch checks to see if the FILE_ATTRIBUTE_REPARSE_POINT attrinbute is set, and if so, it sets the type of that file or directory to a link while emitting data for getdents64 and related syscalls. This patch does fix the updatedb issue I was encountering, as apparently updatedb stops traversing once it hits a symlink. Gabriel Marcano (1): fs/ntfs3: fix directory element type detection fs/ntfs3/dir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) base-commit: 44b4494d5c5971dc8f531c8783d90a637e862880 -- 2.42.0