diff options
author | Mateusz Guzik <mjguzik@gmail.com> | 2025-09-11 08:56:41 +0200 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-09-15 14:31:03 +0200 |
commit | cde560f98a9b6e64dd675f6bd10137cc8243a32a (patch) | |
tree | bdf817c77b88a3fd437d03aa2eb5a5ee4a8f7f5d | |
parent | 90ccf10de527c0c9b117beddd09ee7ac38efaa5b (diff) |
fs: expand dump_inode()
This adds fs name and few fields from struct inode: i_mode, i_opflags,
i_flags, i_state and i_count.
All values printed raw, no attempt to pretty-print anything.
Compile tested on i386 and runtime tested on amd64.
Sample output:
[ 23.121281] VFS_WARN_ON_INODE("crap") encountered for inode ffff9a1a83ce3660
fs pipefs mode 10600 opflags 0x4 flags 0x0 state 0x38 count 0
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
-rw-r--r-- | fs/inode.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index 833de5457a06..bf7503760206 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2935,10 +2935,18 @@ EXPORT_SYMBOL(mode_strip_sgid); * * TODO: add a proper inode dumping routine, this is a stub to get debug off the * ground. + * + * TODO: handle getting to fs type with get_kernel_nofault()? + * See dump_mapping() above. */ void dump_inode(struct inode *inode, const char *reason) { - pr_warn("%s encountered for inode %px", reason, inode); + struct super_block *sb = inode->i_sb; + + pr_warn("%s encountered for inode %px\n" + "fs %s mode %ho opflags 0x%hx flags 0x%x state 0x%x count %d\n", + reason, inode, sb->s_type->name, inode->i_mode, inode->i_opflags, + inode->i_flags, inode->i_state, atomic_read(&inode->i_count)); } EXPORT_SYMBOL(dump_inode); |