Re: [f2fs-dev] [PATCH 03/14] f2fs: support regular file buffered writes on large folios
From: Nanzhe Zhao
Date: Thu Sep 10 2026 - 06:52:26 EST
> ret = submit_bio_wait(bio);
I wish I could use submit_bio_wait() to implement this sync read function,
but I found the following two problems:
1. submit_bio_wait() -> bio_await() unconditionally overwrites
bi_private/bi_end_io, so f2fs_read_end_io() never runs: all post-read
handling (tracepoint, iostat, verity/decompress, ffs bookkeeping) plus
the iostat ctx lifecycle is lost. (Even if we allocate the bio with
f2fs_grab_read_bio().)
2. f2fs_submit_read_bio() calls blk_crypto_submit_bio(); on devices
without inline crypto, its read semantics rely on
blk_crypto_fallback_bio_prep() taking over exactly bi_private/bi_end_io
and restoring them via a hooked decrypt completion. Those are the same
two fields that submit_bio_wait() owns, so the two cannot coexist.
>From my investigation, I found that if we insist on using submit_bio_wait()
while preserving all the original f2fs semantics, the implementation becomes
very complex. That is why I went with this hacky approach. If you have any
better ideas, please let me know.
See https://lore.kernel.org/linux-f2fs-devel/f1ad5d3d-f4c5-498f-8378-a5efff74a458@xxxxxxxxxx/ for more information