[f2fs-dev] [PATCH] f2fs: check free sections before disable checkpoint

2023-12-28 Thread Wu Bo via Linux-f2fs-devel
'f2fs_is_checkpoint_ready()' checks free sections. If there is not enough free sections, most f2fs operations will return -ENOSPC when checkpoint is disabled. It would be better to check free sections before disable checkpoint. Signed-off-by: Wu Bo --- fs/f2fs/segment.c | 2 ++ 1 file changed,

Re: [f2fs-dev] [PATCH 5/6] f2fs: fix to restrict condition of compress inode conversion

2023-12-28 Thread Chao Yu
On 2023/12/13 6:21, Jaegeuk Kim wrote: On 12/12, Chao Yu wrote: On 2023/12/12 6:11, Jaegeuk Kim wrote: On 12/10, Chao Yu wrote: This patch adds i_size check during compress inode conversion in order to avoid .page_mkwrite races w/ conversion. Which race condition do you see? Something like

[f2fs-dev] [PATCH v3 4/6] f2fs: compress: fix to avoid inconsistent bewteen i_blocks and dnode

2023-12-28 Thread Chao Yu
In reserve_compress_blocks(), we update blkaddrs of dnode in prior to inc_valid_block_count(), it may cause inconsistent status bewteen i_blocks and blkaddrs once inc_valid_block_count() fails. To fix this issue, it needs to reverse their invoking order. Fixes: c75488fb4d82 ("f2fs: introduce F2FS

[f2fs-dev] [PATCH v3 6/6] f2fs: introduce FAULT_BLKADDR_INCONSISTENCE

2023-12-28 Thread Chao Yu
We will encounter below inconsistent status when FAULT_BLKADDR type fault injection is on. Info: checkpoint state = d6 : nat_bits crc fsck compacted_summary orphan_inodes sudden-power-off [ASSERT] (fsck_chk_inode_blk:1254) --> ino: 0x1c100 has i_blocks: 00c0, but has 191 blocks [FIX] (fsck

[f2fs-dev] [PATCH v3 2/6] f2fs: compress: fix to cover normal cluster write with cp_rwsem

2023-12-28 Thread Chao Yu
When we overwrite compressed cluster w/ normal cluster, we should not unlock cp_rwsem during f2fs_write_raw_pages(), otherwise data will be corrupted if partial blocks were persisted before CP & SPOR, due to cluster metadata wasn't updated atomically. Fixes: 4c8ff7095bef ("f2fs: support data compr

[f2fs-dev] [PATCH v3 5/6] f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic

2023-12-28 Thread Chao Yu
verify_blkaddr() will trigger panic once we inject fault into f2fs_is_valid_blkaddr(), fix to remove this unnecessary f2fs_bug_on(). Fixes: 18792e64c86d ("f2fs: support fault injection for f2fs_is_valid_blkaddr()") Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 4 +--- 1 file changed, 1 insertion(

[f2fs-dev] [PATCH v3 3/6] f2fs: compress: fix to check unreleased compressed cluster

2023-12-28 Thread Chao Yu
From: Sheng Yong Compressed cluster may not be released due to we can fail in release_compress_blocks(), fix to handle reserved compressed cluster correctly in reserve_compress_blocks(). Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Sheng Yong Signed-off-by: Chao Yu ---

[f2fs-dev] [PATCH v3 1/6] f2fs: compress: fix to guarantee persisting compressed blocks by CP

2023-12-28 Thread Chao Yu
If data block in compressed cluster is not persisted with metadata during checkpoint, after SPOR, the data may be corrupted, let's guarantee to write compressed page by checkpoint. Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Chao Yu --- v3: - treat compressed page as CP

Re: [f2fs-dev] [syzbot] [reiserfs?] possible deadlock in super_lock

2023-12-28 Thread Christian Brauner
On Sun, Dec 24, 2023 at 08:40:05AM -0800, syzbot wrote: > syzbot suspects this issue was fixed by commit: > > commit fd1464105cb37a3b50a72c1d2902e97a71950af8 > Author: Jan Kara > Date: Wed Oct 18 15:29:24 2023 + > > fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock > > bisect