Skip to content

fs/ntfs3: fix directory element type detection

Gabriel Marcano ntfs3 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1fs/ntfs3: fix directory element type detectionfs/ntfs3/dir.c+5 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] fs/ntfs3: fix directory element type detection

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

Signature · 1 line
2.42.0