mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liubaolin <liubaolin12138@163.com>
To: Hongling Zeng <zenghongling@kylinos.cn>,
	linkinjeon@kernel.org, hyc.lee@gmail.com
Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org,
	Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH v3 1/6] ntfs: mark the record dirtied by a resident write at iomap begin
Date: Mon, 30 Nov 2026 11:49:03 +0800	[thread overview]
Message-ID: <615143b6-da2b-4d8e-b974-653024d59360@163.com> (raw)
In-Reply-To: <20261130030708.59798-2-zenghongling@kylinos.cn>



在 2026/11/30 11:07, Hongling Zeng 写道:
> A buffered write to a resident attribute is copied straight into the
> mft record found by the search in ntfs_write_iomap_begin_resident().
> With an attribute list that record can be an extent record, while
> ntfs_write_iomap_end_resident() only marks the base inode dirty, so
> the record holding the copied data is never written out and the write
> is lost on a clean unmount.
> 
> Mark the record the lookup found at begin time, while the search
> context still points at it.  This is safe against a concurrent
> writeback of the record: extent records are only written out from the
> write_inode path of the base inode, which takes the same mrec_lock
> the write path holds until iomap_end.
> 
> Keep marking the base record in iomap_end.  The base record also
> holds the standard information, which the write's timestamp update
> modifies and which is likewise only written out when the record is
> marked dirty.
> 
> Fixes: b041ca562526 ("ntfs: update iomap and address space operations")
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
> ---
>   fs/ntfs/iomap.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/fs/ntfs/iomap.c b/fs/ntfs/iomap.c
> index ce916707f69b..8933f432aa68 100644
> --- a/fs/ntfs/iomap.c
> +++ b/fs/ntfs/iomap.c
> @@ -682,6 +682,15 @@ static int ntfs_write_iomap_begin_resident(struct inode *inode, loff_t offset,
>   		goto out;
>   	}
>   
> +	/*
> +	 * The record holding a resident attribute can be an extent record.
> +	 * Mark the record the lookup found dirty here, while the search
> +	 * context still points at it.  The writeout of the record cannot
> +	 * overtake the inline copy: it is serialized by the mrec_lock held
> +	 * until iomap_end.
> +	 */
> +	mark_mft_record_dirty(ctx->ntfs_ino);
> +
>   	a = ctx->attr;
>   	/* The total length of the attribute value. */
>   	attr_len = le32_to_cpu(a->data.resident.value_length);

Looks good to me.

Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>


  reply	other threads:[~2026-11-30  3:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  3:07 [PATCH v3 0/6] ntfs: synchronize the in-memory size handling Hongling Zeng
2026-11-30  3:07 ` [PATCH v3 1/6] ntfs: mark the record dirtied by a resident write at iomap begin Hongling Zeng
2026-11-30  3:49   ` liubaolin [this message]
2026-11-30  3:07 ` [PATCH v3 2/6] ntfs: roll back the size update when the attribute lookup fails Hongling Zeng
2026-11-30  3:49   ` liubaolin
2026-11-30  3:07 ` [PATCH v3 3/6] ntfs: read initialized_size under size_lock in the iomap paths Hongling Zeng
2026-11-30  3:49   ` liubaolin
2026-11-30  3:07 ` [PATCH v3 4/6] ntfs: update the in-memory sizes under the size lock Hongling Zeng
2026-11-30  3:49   ` liubaolin
2026-11-30  3:07 ` [PATCH v3 5/6] ntfs: serialize the mmap write fault initialized size update Hongling Zeng
2026-11-30  3:49   ` liubaolin
2026-11-30  3:07 ` [PATCH v3 6/6] ntfs: read initialized_size under size_lock in the mmap prepare path Hongling Zeng
2026-11-30  3:50   ` liubaolin

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=615143b6-da2b-4d8e-b974-653024d59360@163.com \
    --to=liubaolin12138@163.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin@kylinos.cn \
    --cc=ntfs@lists.linux.dev \
    --cc=zenghongling@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®