linux/fs/f2fs
Yongpeng Yang 1f70ddb28a f2fs: fix incorrect FI_NO_EXTENT handling in __destroy_extent_node()
When __destroy_extent_node() sets the inode flag FI_NO_EXTENT, it does
not reset the length of the largest extent to 0 and update the inode
folio. Since modifications to the extent tree are disallowed afterward,
the cached largest extent may become stale. This can trigger the
following error in xfstests generic/388:

F2FS-fs (dm-0): sanity_check_extent_cache: inode (ino=1761) extent info [220057, 57, 6] is incorrect, run fsck to fix

In the f2fs_drop_inode path, __destroy_extent_node() does not need to
guarantee that et->node_cnt is 0, because concurrency with writeback
is expected in this path, and writeback may update the extent cache.

This patch reverts commit ed78aeebef ("f2fs: fix node_cnt race between
extent node destroy and writeback"), and remove the unnecessary zero
check of et->node_cnt.

Fixes: ed78aeebef ("f2fs: fix node_cnt race between extent node destroy and writeback")
Cc: stable@vger.kernel.org
Reported-by: Chao Yu <chao@kernel.org>
Suggested-by: Chao Yu <chao@kernel.org>
Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
History 2026-05-22 03:49:06 +00:00
..
acl.c fs: inline current_umask() and move it to fs_struct.h 2025-11-05 22:51:23 +01:00
acl.h f2fs: Pass folios to f2fs_init_acl() 2025-04-28 15:26:41 +00:00
checkpoint.c f2fs-for-7.1-rc1 2026-04-21 14:50:04 -07:00
compress.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
data.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
debug.c f2fs: Add defrag_blocks sysfs node 2026-03-24 17:20:59 +00:00
dir.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
extent_cache.c f2fs: fix incorrect FI_NO_EXTENT handling in __destroy_extent_node() 2026-05-22 03:49:06 +00:00
f2fs.h f2fs: map data writes to FDP streams 2026-05-22 03:49:06 +00:00
file.c f2fs: map data writes to FDP streams 2026-05-22 03:49:06 +00:00
gc.c f2fs-for-7.1-rc1 2026-04-21 14:50:04 -07:00
gc.h f2fs: set default valid_thresh_ratio to 80 for zoned devices 2025-10-24 21:23:55 +00:00
hash.c fs: add helpers name_is_dot{,dot,_dotdot} 2026-01-29 10:06:59 +01:00
inline.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
inode.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
iostat.c f2fs: add page-order information for large folio reads in iostat 2026-04-18 22:44:42 +00:00
iostat.h f2fs: add page-order information for large folio reads in iostat 2026-04-18 22:44:42 +00:00
Kconfig f2fs: switch to using the crc32 library 2024-12-01 17:23:02 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs-for-7.1-rc1 2026-04-21 14:50:04 -07:00
node.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
node.h f2fs: refactor node footer flag setting related code 2026-04-02 16:24:18 +00:00
recovery.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
segment.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
segment.h f2fs: stop using writeback internals for dirty_exceeded checks 2026-02-17 13:25:14 +01:00
shrinker.c f2fs: handle error cases of memory donation 2025-05-06 15:46:55 +00:00
super.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
sysfs.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
verity.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
xattr.c f2fs: support to report fserror 2026-05-22 03:49:06 +00:00
xattr.h f2fs: use global inline_xattr_slab instead of per-sb slab cache 2025-12-04 02:00:02 +00:00