All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiucheng Xu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chao Yu <chao@kernel.org>, Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file
Date: Mon, 7 Sep 2026 16:45:23 +0800	[thread overview]
Message-ID: <6e2adf29-e3a6-4033-80f8-e3ed672f47ac@amlogic.com> (raw)
In-Reply-To: <b90c9052-b44b-404a-85cc-8221249b63d7@kernel.org>

On 9/7/2026 3:08 PM, Chao Yu wrote:
> [ EXTERNAL EMAIL ]
> 
> On 9/2/26 11:18, Jiucheng Xu wrote:
> 
> Jiucheng,
> 
> Sorry for delay reply.
> 
> 
> I didn't get it, can you please describe the issue w/ call stack in race
> condition?
>
Hi Chao,

Thanks for your time, The call stack is shown as below:

-Thread A                                         - Thread B
 - f2fs_write_multi_pages                          -
f2fs_down_write(&sbi->cp_rwsem);
  - f2fs_write_compressed_pages                    - ...
   - f2fs_trylock_op                               - ...
    - f2fs_down_read_trylock(&sbi->cp_rwsem);      - ...
  - f2fs_write_raw_pages                           - ...

Thread B acquires the lock first, which causes Thread A to fail lock
acquisition and fall back to raw‑data write.
IPU_FORCE is enabled on 16G eMMC platforms, so f2fs_write_raw_pages()
overwrites the original compressed data in‑place.
The in‑memory node has been updated with raw‑data addresses, while the
node metadata stored on eMMC still remains in compressed state.
If a power‑cut occurs before the node is flushed to disk, on‑disk
inconsistency arises: The data on disk is raw, but metadata
still treats it as a compressed cluster and decompression will fail.




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

  reply	other threads:[~2026-09-07  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5de3d9c8-e847-422f-a9e4-31ac2a1b5c2e@amlogic.com>
2026-09-07  7:08 ` [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file Chao Yu via Linux-f2fs-devel
2026-09-07  8:45   ` Jiucheng Xu via Linux-f2fs-devel [this message]
2026-09-07 10:38     ` Chao Yu 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=6e2adf29-e3a6-4033-80f8-e3ed672f47ac@amlogic.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=jiucheng.xu@amlogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.