Skip to content

show orphan file inode detail info

Ye Bin linux-ext4 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 5 repliesIn review
  2. v13 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ext4: register 'orphan_list' procfsfs/ext4/ext4.h fs/ext4/orphan.c fs/ext4/sysfs.c+80 -00 replies
2/4ext4: skip cursor node in ext4_orphan_del()fs/ext4/orphan.c+19 -11 reply
3/4ext4: show inode orphan list detail informationfs/ext4/orphan.c+126 -20 replies
4/4ext4: show orphan file inode detail infofs/ext4/orphan.c+146 -330 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] show orphan file inode detail info

From: Ye Bin <[email protected]>

Diffs v2 vs v1:
(1) Fix sashiko review issues:
https://sashiko.dev/#/patchset/20260403082507.1882703-1-yebin%40huaweicloud.com
(2) Change "orphan_list" file mode from 0444 to 0400;
(3) The display format of the "orphan_list" file is modified according to Andreas' suggestions.
Fault injection tests have been conducted to address the issues raised in the sashik review. There is no UAF issue in the ext4_seq_orphan_release() function. The reason for this has already been explained in the code comments. In addition to the fault injection tests, we also performed a stress test by observing the /proc/fs/ext4/XX/orphan_list and the concurrent processes of adding and removing orphan nodes, and no issues were found so far.

In actual production environments, the issue of inconsistency between df and du is frequently encountered. In many cases, the cause of the problem can be identified through the use of lsof. However, when overlayfs is combined with project quota configuration, the issue becomes more complex and troublesome to diagnose. First, to determine the project ID, one needs to obtain orphaned nodes using fsck.ext4 -fn /dev/xx, and then retrieve file information through debugfs. However, the file names cannot always be obtained, and it is often unclear which files they are. To identify which files these are, one would need to use crash for online debugging or use kprobe to gather information incrementally. However, some customers in production environments do not agree to upload any tools, and online debugging might impact the business. There are also scenarios where files are opened in kernel mode, which do not generate file descriptors(fds), making it impossible to identify which files were deleted but still have references through lsof. This patchset adds a procfs interface to query information about orphaned nodes, which can assist in the analysis and localization of such issues.

Ye Bin (4):
ext4: register 'orphan_list' procfs
ext4: skip cursor node in ext4_orphan_del()
ext4: show inode orphan list detail information
ext4: show orphan file inode detail info

 fs/ext4/ext4.h   |   1 +
 fs/ext4/orphan.c | 326 ++++++++++++++++++++++++++++++++++++++++++++++-
 fs/ext4/sysfs.c  |   2 +
 3 files changed, 328 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1