]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
f2fs: honor per-I/O write streams for direct writes
authorWenjie Qi <qwjhust@gmail.com>
Fri, 22 May 2026 06:12:06 +0000 (14:12 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:36 +0000 (19:52 +0000)
commit28ebb922b99d415e8bf51bf8b065a14fd7672167
tree5da4aa3fcce3f34c6baf7fc9e40b2429f40214cd
parent8712353ed80f87271d732297567dcdbe4b84e8c7
f2fs: honor per-I/O write streams for direct writes

io_uring can pass a per-I/O write stream through kiocb->ki_write_stream,
and block direct I/O propagates that value to bio->bi_write_stream.

F2FS added FDP stream mapping for DATA writes, but its direct write
submit hook always rewrites bio->bi_write_stream from the inode write
hint and F2FS temperature. As a result, a direct write with an explicit
io_uring write_stream is submitted to the F2FS-selected stream instead
of the user-requested stream.

Validate an explicit write stream before starting F2FS direct I/O, pass
the kiocb through the iomap private pointer, and preserve the per-I/O
stream in the direct write bio. When no per-I/O stream is supplied, keep
using the existing F2FS temperature-to-stream mapping.

Fixes: 42f7a7a50a33 ("f2fs: map data writes to FDP streams")
Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c