Re: [PATCH v5 09/12] f2fs: cache: use compress cache
From: Wenjie Qi
Date: Wed Sep 02 2026 - 08:15:02 EST
Hi Chao,
> entry = f2fs_insert_cache(cache, index, new);
> found:
> if (lock) {
> f2fs_lock_cache(entry);
> }
and the compressed-cache caller initializes the identity afterwards:
> entry = f2fs_grab_cache(COMPRESS_CACHE(sbi), blkaddr,
> F2FS_CACHE_LOCK_CREATE);
> if (IS_ERR(entry))
> return;
>
> entry->ino = ino;
while inode invalidation reads:
> if (entry->ino != ino)
> continue;
A new entry is inserted before `f2fs_grab_cache()` acquires its entry lock.
Its `ino` is still zero until the compressed-cache caller initializes it.
The gang lookup pins the entry but does not lock it, and invalidation compares
`entry->ino` before `f2fs_truncate_cache()` takes the entry lock.