Linux-f2fs-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Wenjie Qi <qwjhust@gmail.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com,
	daehojeong@google.com, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: keep atomic write retry from zeroing original data
Date: Thu, 11 Jun 2026 16:12:30 +0800	[thread overview]
Message-ID: <42d9f2ed-2402-46dd-a8d5-37dca2adfb29@kernel.org> (raw)
In-Reply-To: <20260527120628.2255597-1-qiwenjie@xiaomi.com>

On 5/27/26 20:06, Wenjie Qi wrote:
> A partial atomic write reserves a block in the COW inode before reading the
> original data page for the untouched bytes in that page.
> 
> If that read fails, write_begin returns an error but leaves the COW inode
> entry as NEW_ADDR. A retry of the same partial write then finds the COW
> entry, treats it as existing COW data, and f2fs_write_begin() zeroes the
> whole folio because blkaddr is NEW_ADDR.
> 
> If the retry is committed, the bytes outside the retried write range are
> committed as zeroes instead of preserving the original file contents.
> 
> Only use the COW inode as the read source when it already has a real data
> block. If the COW entry is still NEW_ADDR, treat it as a reservation to
> reuse: keep reading the old data from the original inode and avoid
> reserving or accounting the same atomic block again.
> 

Cc: stable@kernel.org

> Fixes: 3db1de0e582c ("f2fs: change the current atomic write way")
> Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2026-06-11  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 12:06 [f2fs-dev] [PATCH] f2fs: keep atomic write retry from zeroing original data Wenjie Qi
2026-06-11  8:12 ` Chao Yu via Linux-f2fs-devel [this message]
2026-06-15 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel

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=42d9f2ed-2402-46dd-a8d5-37dca2adfb29@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=daehojeong@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiwenjie@xiaomi.com \
    --cc=qwjhust@gmail.com \
    /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