[f2fs-dev] [PATCH 6.1 7/8] block: fix race between set_blocksize and read paths

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: "Darrick J. Wong" commit c0e473a0d226479e8e925d5ba93f751d8df628e9 upstream. With the new large sector size support, it's now the case that set_blocksize can change i_blksize and the folio order in a manner that conflicts with a concurrent reader and causes a kernel crash. Specifically, le

[f2fs-dev] [PATCH 6.1 6/8] block: open code __generic_file_write_iter for blkdev writes

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Christoph Hellwig commit 727cfe976758b79f8d2f8051c75a5ccb14539a56 upstream. Open code __generic_file_write_iter to remove the indirect call into ->direct_IO and to prepare using the iomap based write code. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Chr

[f2fs-dev] [PATCH 6.1 8/8] nilfs2: fix deadlock warnings caused by lock dependency in init_nilfs()

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Ryusuke Konishi commit fb881cd7604536b17a1927fb0533f9a6982ffcc5 upstream. After commit c0e473a0d226 ("block: fix race between set_blocksize and read paths") was merged, set_blocksize() called by sb_set_blocksize() now locks the inode of the backing device file. As a result of this change,

[f2fs-dev] [PATCH 6.1 4/8] fs: factor out a direct_write_fallback helper

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Christoph Hellwig commit 44fff0fa08ec5a6d9d5fb05443a36d854d0ece4d upstream. Add a helper dealing with handling the syncing of a buffered write fallback for direct I/O. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Christoph Hellwig Reviewed-by: Damie

[f2fs-dev] [PATCH 6.1 2/8] filemap: add a kiocb_invalidate_post_direct_write helper

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Christoph Hellwig commit c402a9a9430b670926decbb284b756ee6f47c1ec upstream. Add a helper to invalidate page cache after a dio write. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reine

[f2fs-dev] [PATCH 6.1 3/8] filemap: update ki_pos in generic_perform_write

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Christoph Hellwig commit 182c25e9c157f37bd0ab5a82fe2417e2223df459 upstream. All callers of generic_perform_write need to updated ki_pos, move it into common code. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Christoph Hellwig Reviewed-by: Xiubo Li R

[f2fs-dev] [PATCH 6.1 5/8] direct_write_fallback(): on error revert the ->ki_pos update from buffered write

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Al Viro commit 8287474aa5ffb41df52552c4ae4748e791d2faf2 upstream. If we fail filemap_write_and_wait_range() on the range the buffered write went into, we only report the "number of bytes which we direct-written", to quote the comment in there. Which is fine, but buffered write has already

[f2fs-dev] [PATCH 6.1 0/8] Backporting CVE-2025-38073 fix patch

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
This series aims to fix the CVE-2025-38073 for 6.1 LTS. Which is fixed by c0e473a0d226 ("block: fix race between set_blocksize and read paths"). This patch is built on top multiple refactors that where merged on 6.6. The needed dependecies are: - e003f74afbd2 ("filemap: add a kiocb_invalidate_pa

[f2fs-dev] [PATCH 6.1 1/8] filemap: add a kiocb_invalidate_pages helper

2025-10-21 Thread Mahmoud Adam via Linux-f2fs-devel
From: Christoph Hellwig commit e003f74afbd2feadbb9ffbf9135e2d2fb5d320a5 upstream. Factor out a helper that calls filemap_write_and_wait_range and invalidate_inode_pages2_range for the range covered by a write kiocb or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to w