[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bc467c0d-99d0-4de7-9d09-a5e155f7ba4e@paragon-software.com>
Date: Tue, 23 Apr 2024 09:59:53 +0300
From: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To: Johan Hovold <johan@...nel.org>
CC: <ntfs3@...ts.linux.dev>, LKML <linux-kernel@...r.kernel.org>,
Linux-fsdevel <linux-fsdevel@...r.kernel.org>, "Matthew Wilcox (Oracle)"
<willy@...radead.org>, Anton Altaparmakov <anton@...era.com>
Subject: Re: [PATCH 11/11] fs/ntfs3: Taking DOS names into account during link
counting
On 18.04.2024 09:31, Johan Hovold wrote:
> On Wed, Apr 17, 2024 at 04:10:59PM +0300, Konstantin Komarov wrote:
>> When counting and checking hard links in an ntfs file record,
>>
>> struct MFT_REC {
>> struct NTFS_RECORD_HEADER rhdr; // 'FILE'
>> __le16 seq; // 0x10: Sequence number for this record.
>> >> __le16 hard_links; // 0x12: The number of hard links to record.
>> __le16 attr_off; // 0x14: Offset to attributes.
>> ...
>>
>> the ntfs3 driver ignored short names (DOS names), causing the link count
>> to be reduced by 1 and messages to be output to dmesg.
> I also reported seeing link counts being reduced by 2:
>
> [ 78.307412] ntfs3: nvme0n1p3: ino=34e6, Correct links count -> 1 (3).
> [ 78.307843] ntfs3: nvme0n1p3: ino=5bb23, Correct links count -> 1 (2).
> [ 78.308509] ntfs3: nvme0n1p3: ino=5c722, Correct links count -> 1 (2).
> [ 78.310018] ntfs3: nvme0n1p3: ino=5d761, Correct links count -> 1 (2).
> [ 78.310717] ntfs3: nvme0n1p3: ino=33d18, Correct links count -> 1 (3).
> [ 78.311179] ntfs3: nvme0n1p3: ino=5d75b, Correct links count -> 1 (3).
> [ 78.311605] ntfs3: nvme0n1p3: ino=5c708, Correct links count -> 1 (3).
>
> - https://lore.kernel.org/all/Zhz_axTjkJ6Aqeys@hovoldconsulting.com/
>
> Are you sure there are not further issues with this code?
>
>> For Windows, such a situation is a minor error, meaning chkdsk does not
>> report
>> errors on such a volume, and in the case of using the /f switch, it silently
>> corrects them, reporting that no errors were found. This does not affect
>> the consistency of the file system.
>>
>> Nevertheless, the behavior in the ntfs3 driver is incorrect and
>> changes the content of the file system. This patch should fix that.
> This patch is white space damaged and does not apply.
>
>> PS: most likely, there has been a confusion of concepts
>> MFT_REC::hard_links and inode::__i_nlink.
> I'd also expect a Fixes and CC stable tag here.
>
> And as this patch does not seem to depend on the rest of the series it
> should go first (along with any other bug fixes).
>
>> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
> Johan
Hi Johan,
We are in the process of extending the tests for link counting and
related scenarios.
If I find bugs, I'll reply ASAP.
Thanks for highlighting the bug.
Powered by blists - more mailing lists