* [PATCH] fs: expand dump_inode()
@ 2025-09-09 8:26 Mateusz Guzik
2025-09-15 12:15 ` Christian Brauner
0 siblings, 1 reply; 4+ messages in thread
From: Mateusz Guzik @ 2025-09-09 8:26 UTC (permalink / raw)
To: brauner; +Cc: viro, jack, linux-kernel, linux-fsdevel, Mateusz Guzik
This adds fs name and few fields from struct inode: i_mode, i_opflags,
i_flags and i_state.
All values printed raw, no attempt to pretty-print anything.
Compile tested on for i386 and runtime tested on amd64.
Sample output:
[ 31.450263] VFS_WARN_ON_INODE("crap") encountered for inode ffff9b10837a3240
fs sockfs mode 140777 opflags c flags 0 state 100
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
This is generated against master.
Depending on where this lands you might get a trivial merge conflict as
it gets rid of the whitespace issue also fixed in https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/commit/?h=vfs-6.18.inode.refcount.preliminaries&id=90ccf10de527c0c9b117beddd09ee7ac38efaa5b
fs/inode.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/fs/inode.c b/fs/inode.c
index 01ebdc40021e..fe7591186b6e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2911,10 +2911,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 %hx flags %u state %x\n",
+ reason, inode, sb->s_type->name, inode->i_mode, inode->i_opflags,
+ inode->i_flags, inode->i_state);
}
EXPORT_SYMBOL(dump_inode);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] fs: expand dump_inode()
2025-09-09 8:26 [PATCH] fs: expand dump_inode() Mateusz Guzik
@ 2025-09-15 12:15 ` Christian Brauner
2025-09-15 12:17 ` Mateusz Guzik
0 siblings, 1 reply; 4+ messages in thread
From: Christian Brauner @ 2025-09-15 12:15 UTC (permalink / raw)
To: Mateusz Guzik; +Cc: viro, jack, linux-kernel, linux-fsdevel
On Tue, Sep 09, 2025 at 10:26:13AM +0200, Mateusz Guzik wrote:
> This adds fs name and few fields from struct inode: i_mode, i_opflags,
> i_flags and i_state.
>
> All values printed raw, no attempt to pretty-print anything.
>
> Compile tested on for i386 and runtime tested on amd64.
>
> Sample output:
> [ 31.450263] VFS_WARN_ON_INODE("crap") encountered for inode ffff9b10837a3240
> fs sockfs mode 140777 opflags c flags 0 state 100
>
> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
> ---
Applied to vfs-6.18.misc.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] fs: expand dump_inode()
2025-09-15 12:15 ` Christian Brauner
@ 2025-09-15 12:17 ` Mateusz Guzik
2025-09-15 13:42 ` Christian Brauner
0 siblings, 1 reply; 4+ messages in thread
From: Mateusz Guzik @ 2025-09-15 12:17 UTC (permalink / raw)
To: Christian Brauner; +Cc: viro, jack, linux-kernel, linux-fsdevel
On Mon, Sep 15, 2025 at 2:15 PM Christian Brauner <brauner@kernel.org> wrote:
>
> On Tue, Sep 09, 2025 at 10:26:13AM +0200, Mateusz Guzik wrote:
> > This adds fs name and few fields from struct inode: i_mode, i_opflags,
> > i_flags and i_state.
> >
> > All values printed raw, no attempt to pretty-print anything.
> >
> > Compile tested on for i386 and runtime tested on amd64.
> >
> > Sample output:
> > [ 31.450263] VFS_WARN_ON_INODE("crap") encountered for inode ffff9b10837a3240
> > fs sockfs mode 140777 opflags c flags 0 state 100
> >
> > Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
> > ---
>
> Applied to vfs-6.18.misc.
I posted a v2: https://lore.kernel.org/linux-fsdevel/20250911065641.1564625-1-mjguzik@gmail.com/
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] fs: expand dump_inode()
2025-09-15 12:17 ` Mateusz Guzik
@ 2025-09-15 13:42 ` Christian Brauner
0 siblings, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2025-09-15 13:42 UTC (permalink / raw)
To: Mateusz Guzik; +Cc: viro, jack, linux-kernel, linux-fsdevel
On Mon, Sep 15, 2025 at 02:17:22PM +0200, Mateusz Guzik wrote:
> On Mon, Sep 15, 2025 at 2:15 PM Christian Brauner <brauner@kernel.org> wrote:
> >
> > On Tue, Sep 09, 2025 at 10:26:13AM +0200, Mateusz Guzik wrote:
> > > This adds fs name and few fields from struct inode: i_mode, i_opflags,
> > > i_flags and i_state.
> > >
> > > All values printed raw, no attempt to pretty-print anything.
> > >
> > > Compile tested on for i386 and runtime tested on amd64.
> > >
> > > Sample output:
> > > [ 31.450263] VFS_WARN_ON_INODE("crap") encountered for inode ffff9b10837a3240
> > > fs sockfs mode 140777 opflags c flags 0 state 100
> > >
> > > Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
> > > ---
> >
> > Applied to vfs-6.18.misc.
>
> I posted a v2: https://lore.kernel.org/linux-fsdevel/20250911065641.1564625-1-mjguzik@gmail.com/
Yeah, I picked that.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-15 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 8:26 [PATCH] fs: expand dump_inode() Mateusz Guzik
2025-09-15 12:15 ` Christian Brauner
2025-09-15 12:17 ` Mateusz Guzik
2025-09-15 13:42 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox