NTFS3 file system kernel mode driver
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Johan Hovold <johan@kernel.org>
Cc: <ntfs3@lists.linux.dev>, LKML <linux-kernel@vger.kernel.org>,
	Linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Anton Altaparmakov <anton@tuxera.com>
Subject: Re: [PATCH 11/11] fs/ntfs3: Taking DOS names into account during link counting
Date: Tue, 23 Apr 2024 09:59:53 +0300	[thread overview]
Message-ID: <bc467c0d-99d0-4de7-9d09-a5e155f7ba4e@paragon-software.com> (raw)
In-Reply-To: <ZiC-TNxianVojCJv@hovoldconsulting.com>

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@paragon-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.


  reply	other threads:[~2024-04-23  6:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 13:03 [PATCH 00/11] Bugfix and refactoring Konstantin Komarov
2024-04-17 13:04 ` [PATCH 01/11] fs/ntfs3: Remove max link count info display during driver init Konstantin Komarov
2024-04-17 13:04 ` [PATCH 02/11] fs/ntfs3: Missed le32_to_cpu conversion Konstantin Komarov
2024-04-17 13:06 ` [PATCH 03/11] fs/ntfs3: Mark volume as dirty if xattr is broken Konstantin Komarov
2024-04-17 13:06 ` [PATCH 04/11] fs/ntfs3: Use variable length array instead of fixed size Konstantin Komarov
2024-04-17 13:06 ` [PATCH 05/11] fs/ntfs3: Use 64 bit variable to avoid 32 bit overflow Konstantin Komarov
2024-04-17 13:07 ` [PATCH 06/11] fs/ntfs3: Redesign ntfs_create_inode to return error code instead of inode Konstantin Komarov
2024-04-17 13:07 ` [PATCH 07/11] fs/ntfs3: Check 'folio' pointer for NULL Konstantin Komarov
2024-04-17 13:08 ` [PATCH 08/11] fs/ntfs3: Always make file nonresident if fallocate (xfstest 438) Konstantin Komarov
2024-04-17 13:08 ` [PATCH 09/11] fs/ntfs3: Optimize to store sorted attribute definition table Konstantin Komarov
2024-04-17 13:09 ` [PATCH 10/11] fs/ntfs3: Remove cached label from sbi Konstantin Komarov
2024-04-22 20:42   ` Nathan Chancellor
2024-04-17 13:10 ` [PATCH 11/11] fs/ntfs3: Taking DOS names into account during link counting Konstantin Komarov
2024-04-18  6:31   ` Johan Hovold
2024-04-23  6:59     ` Konstantin Komarov [this message]
2024-04-18  6:42 ` [PATCH 00/11] Bugfix and refactoring Johan Hovold

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=bc467c0d-99d0-4de7-9d09-a5e155f7ba4e@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=anton@tuxera.com \
    --cc=johan@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=willy@infradead.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).