linux-yocto/fs/ext4
Jan Kara f50bece98c ext4: fix checks for orphan inodes
commit acf943e9768ec9d9be80982ca0ebc4bfd6b7631e upstream.

When orphan file feature is enabled, inode can be tracked as orphan
either in the standard orphan list or in the orphan file. The first can
be tested by checking ei->i_orphan list head, the second is recorded by
EXT4_STATE_ORPHAN_FILE inode state flag. There are several places where
we want to check whether inode is tracked as orphan and only some of
them properly check for both possibilities. Luckily the consequences are
mostly minor, the worst that can happen is that we track an inode as
orphan although we don't need to and e2fsck then complains (resulting in
occasional ext4/307 xfstest failures). Fix the problem by introducing a
helper for checking whether an inode is tracked as orphan and use it in
appropriate places.

Fixes: 4a79a98c7b ("ext4: Improve scalability of ext4 orphan file handling")
Cc: stable@kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Message-ID: <20250925123038.20264-2-jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-15 12:00:22 +02:00
..
.kunitconfig
acl.c
acl.h
balloc.c ext4: reorder capability check last 2025-05-29 11:02:15 +02:00
bitmap.c
block_validity.c ext4: make block validity check resistent to sb bh corruption 2025-05-02 07:59:25 +02:00
crypto.c
dir.c ext4: fix OOB read when checking dotdot dir 2025-04-10 14:39:39 +02:00
ext4_extents.h
ext4_jbd2.c
ext4_jbd2.h ext4: avoid journaling sb update on error if journal is destroying 2025-09-09 18:58:20 +02:00
ext4.h ext4: fix checks for orphan inodes 2025-10-15 12:00:22 +02:00
extents_status.c
extents_status.h
extents.c ext4: correct the error handle in ext4_fallocate() 2025-08-01 09:48:46 +01:00
fast_commit.c
fast_commit.h
file.c ext4: fix checks for orphan inodes 2025-10-15 12:00:22 +02:00
fsmap.c ext4: fix reserved gdt blocks handling in fsmap 2025-08-28 16:30:56 +02:00
fsmap.h
fsync.c
hash.c
ialloc.c
indirect.c ext4: fix hole length calculation overflow in non-extent inodes 2025-08-28 16:30:56 +02:00
inline.c ext4: do not BUG when INLINE_DATA_FL lacks system.data xattr 2025-08-20 18:30:41 +02:00
inode-test.c
inode.c ext4: fix checks for orphan inodes 2025-10-15 12:00:22 +02:00
ioctl.c
Kconfig
Makefile
mballoc-test.c ext4: initialize superblock fields in the kballoc-test.c kunit tests 2025-08-20 18:30:52 +02:00
mballoc.c ext4: fix largest free orders lists corruption on mb_optimize_scan switch 2025-08-20 18:30:52 +02:00
mballoc.h
migrate.c
mmp.c
move_extent.c
namei.c ext4: introduce linear search for dentries 2025-09-19 16:35:42 +02:00
orphan.c ext4: fix checks for orphan inodes 2025-10-15 12:00:22 +02:00
page-io.c ext4: do not convert the unwritten extents if data writeback fails 2025-05-29 11:02:19 +02:00
readpage.c
resize.c
super.c ext4: fix checks for orphan inodes 2025-10-15 12:00:22 +02:00
symlink.c
sysfs.c
truncate.h
verity.c
xattr_hurd.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c ext4: ignore xattrs past end 2025-04-20 10:15:20 +02:00
xattr.h