Re: [f2fs-dev] [PATCH v2 8/8] fscrypt: Move d_revalidate configuration back into fscrypt

2023-12-20 Thread Al Viro
On Fri, Dec 15, 2023 at 04:16:08PM -0500, Gabriel Krisman Bertazi wrote: > +static const struct dentry_operations fscrypt_dentry_ops = { > + .d_revalidate = fscrypt_d_revalidate, > +}; > + > int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry, >st

Re: [f2fs-dev] [PATCH v2 2/8] fscrypt: Drop d_revalidate if key is available

2023-12-20 Thread Al Viro
On Thu, Dec 21, 2023 at 07:14:02AM +, Al Viro wrote: > On Fri, Dec 15, 2023 at 04:16:02PM -0500, Gabriel Krisman Bertazi wrote: > > fscrypt dentries are always valid once the key is available. Since the > > key cannot be removed without evicting the dentry, we don't need to keep > > retrying t

Re: [f2fs-dev] [PATCH v2 2/8] fscrypt: Drop d_revalidate if key is available

2023-12-20 Thread Al Viro
On Fri, Dec 15, 2023 at 04:16:02PM -0500, Gabriel Krisman Bertazi wrote: > fscrypt dentries are always valid once the key is available. Since the > key cannot be removed without evicting the dentry, we don't need to keep > retrying to revalidate it. > > Signed-off-by: Gabriel Krisman Bertazi > -

[f2fs-dev] [PATCH v2] f2fs: Use wait_event_freezable_timeout() for freezable kthread

2023-12-20 Thread Kevin Hao
A freezable kernel thread can enter frozen state during freezing by either calling try_to_freeze() or using wait_event_freezable() and its variants. So for the following snippet of code in a kernel thread loop: wait_event_interruptible_timeout(); try_to_freeze(); We can change it to a simple w

[f2fs-dev] [PATCH v3] f2fs: New victim selection for GC

2023-12-20 Thread Yonggil Song
Overview This patch introduces a new way to preference data sections when selecting GC victims. Migration of data blocks causes invalidation of node blocks. Therefore, in situations where GC is frequent, selecting data blocks as victims can reduce unnecessary block migration by invalidati

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

2023-12-20 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 3/6] f2fs: compress: fix to check unreleased compressed cluster

2023-12-20 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 1/6] f2fs: compress: fix to guarantee persisting compressed blocks by CP

2023-12-20 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 --- fs/f2fs/compress.c | 3 ++- fs/f

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

2023-12-20 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 5/6] f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic

2023-12-20 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 6/6] f2fs: introduce FAULT_INCONSISTENCE

2023-12-20 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