Skip to content

Commit cde560f

Browse files
mjguzikbrauner
authored andcommitted
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>
1 parent 90ccf10 commit cde560f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

fs/inode.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2935,10 +2935,18 @@ EXPORT_SYMBOL(mode_strip_sgid);
29352935
*
29362936
* TODO: add a proper inode dumping routine, this is a stub to get debug off the
29372937
* ground.
2938+
*
2939+
* TODO: handle getting to fs type with get_kernel_nofault()?
2940+
* See dump_mapping() above.
29382941
*/
29392942
void dump_inode(struct inode *inode, const char *reason)
29402943
{
2941-
pr_warn("%s encountered for inode %px", reason, inode);
2944+
struct super_block *sb = inode->i_sb;
2945+
2946+
pr_warn("%s encountered for inode %px\n"
2947+
"fs %s mode %ho opflags 0x%hx flags 0x%x state 0x%x count %d\n",
2948+
reason, inode, sb->s_type->name, inode->i_mode, inode->i_opflags,
2949+
inode->i_flags, inode->i_state, atomic_read(&inode->i_count));
29422950
}
29432951

29442952
EXPORT_SYMBOL(dump_inode);

0 commit comments

Comments
 (0)