From: Gabriel Marcano <gabemarcano@yahoo.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
Gabriel Marcano <gabemarcano@yahoo.com>
Subject: [PATCH 0/1] fs/ntfs3: fix directory element type detection
Date: Tue, 12 Sep 2023 21:50:31 -0700 [thread overview]
Message-ID: <20230913045032.19651-1-gabemarcano@yahoo.com> (raw)
In-Reply-To: 20230913045032.19651-1-gabemarcano.ref@yahoo.com
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
next parent reply other threads:[~2023-09-13 4:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230913045032.19651-1-gabemarcano.ref@yahoo.com>
2023-09-13 4:50 ` Gabriel Marcano [this message]
2023-09-13 4:50 ` [PATCH 1/1] fs/ntfs3: fix directory element type detection Gabriel Marcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230913045032.19651-1-gabemarcano@yahoo.com \
--to=gabemarcano@yahoo.com \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox