Re: [PATCH v2 1/3] vfs: add initial support for CONFIG_VFS_DEBUG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 7, 2025 at 2:15 PM Jan Kara <jack@xxxxxxx> wrote:
>
> On Thu 06-02-25 18:03:05, Mateusz Guzik wrote:
> > Small collection of macros taken from mmdebug.h
> >
> > Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
>
> For start this looks good! Feel free to add:
>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
>
> BTW:
>
> > +/*
> > + * TODO: add a proper inode dumping routine, this is a stub to get debug off the ground
> > + */
> > +static inline void dump_inode(struct inode *inode, const char *reason) {
> > +     pr_crit("%s failed for inode %px", reason, inode);
> > +}
>
> fs/inode.c:dump_mapping() already has quite a bit of what you'd want here
> so just refactoring dump_mapping() so it can be used in the new asserts
> would get you 90% there I'd think.
>

It looks rather underwhelming.

I was thinking about an equivalent of vn_printf like here:
https://cgit.freebsd.org/src/tree/sys/kern/vfs_subr.c#n4533

Dumps all fields, with spelled out flag names and so on. Also there is
a hook for fs-specific dump routine.

Very useful, but also quite a chore to fully implement and future-proof.
-- 
Mateusz Guzik <mjguzik gmail.com>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux