mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liubaolin <liubaolin12138@163.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: hyc.lee@gmail.com, ntfs@lists.linux.dev,
	linux-kernel@vger.kernel.org, Xuewen Wang <wangxuewen@kylinos.cn>
Subject: Re: [PATCH v2 4/5] ntfs: write unlinked file attributes before dropping their cache
Date: Wed, 4 Nov 2026 17:32:56 +0800	[thread overview]
Message-ID: <df161e1a-7d41-4b53-875e-5c47b7b51193@163.com> (raw)
In-Reply-To: <CAKYAXd-ec8ve6HD5eBJik-LF4PUhZjV7y0c52E2xpALLFA=j2A@mail.gmail.com>



在 2026/11/4 17:06, Namjae Jeon 写道:
>> @@ -4052,6 +4052,14 @@ s64 ntfs_inode_attr_pwrite(struct inode *vi, s64 pos, s64 count, u8 *buf, bool s
>>
>>          WARN_ON(!NInoAttr(ni));
>>
>> +       /*
>> +        * Attribute inodes of an unlinked file have no links either and are
>> +        * evicted at the final iput(). Do not leave their data in dirty pages
>> +        * that eviction would discard while the base file is still open.
>> +        */
>> +       if (!VFS_I(base_ni)->i_nlink && !ntfs_inode_is_named_stream(ni))
>> +               sync = true;
> This misses data dirtied by ntfs_attr_make_non_resident(). For
> example, with 1 KiB MFT records, create an O_TMPFILE, nearly fill
> its MFT record with a resident EA, then write 4 KiB to the file.
> Growing $DATA can force ntfs_resident_attr_resize() to convert
> SECURITY_DESCRIPTOR to nonresident form to make room. the conversion
> only dirties the folio. With patch 5, the subsequent
> iput(tvi) can evict the zero-link attribute inode and discard the SD
> contents before writeback. If the file is later linked with linkat(),
> it can retain invalid SD data after close. Please also ensure that the
> converted data is written back before dropping the last
> attribute-inode reference.
> 
> Thanks!

Hi Namjae,
    Thank you for the review. I will fix this issue and send v3 soon.

Thanks,
Baolin.


  reply	other threads:[~2026-11-04  9:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  5:28 [PATCH v2 0/5] ntfs: support O_TMPFILE Baolin Liu
2026-10-31  5:28 ` [PATCH v2 1/5] ntfs: initialize inherited ACLs after allocating the MFT record Baolin Liu
2026-10-31  5:28 ` [PATCH v2 2/5] ntfs: preserve timestamps when creating hard links Baolin Liu
2026-10-31  5:28 ` [PATCH v2 3/5] ntfs: initialize packed EA size " Baolin Liu
2026-10-31  5:28 ` [PATCH v2 4/5] ntfs: write unlinked file attributes before dropping their cache Baolin Liu
2026-11-04  9:06   ` Namjae Jeon
2026-11-04  9:32     ` liubaolin [this message]
2026-10-31  5:28 ` [PATCH v2 5/5] ntfs: support O_TMPFILE Baolin Liu
2026-11-04  7:03 ` [PATCH v2 0/5] " Hyunchul Lee

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=df161e1a-7d41-4b53-875e-5c47b7b51193@163.com \
    --to=liubaolin12138@163.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs@lists.linux.dev \
    --cc=wangxuewen@kylinos.cn \
    /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

all inboxes | Powered by JetHome®