Re: [PATCH 2/2] xfs: print name of function causing fs shutdown instead of hex pointer

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

 



On Thu, Jun 17, 2021 at 09:11:07AM +0100, Christoph Hellwig wrote:
> On Wed, Jun 16, 2021 at 04:55:36PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@xxxxxxxxxx>
> > 
> > In xfs_do_force_shutdown, print the symbolic name of the function that
> > called us to shut down the filesystem instead of a raw hex pointer.
> > This makes debugging a lot easier:
> > 
> > XFS (sda): xfs_do_force_shutdown(0x2) called from line 2440 of file
> > 	fs/xfs/xfs_log.c. Return address = ffffffffa038bc38
> > 
> > becomes:
> > 
> > XFS (sda): xfs_do_force_shutdown(0x2) called from line 2440 of file
> > 	fs/xfs/xfs_log.c. Return address = xfs_trans_mod_sb+0x25
> 
> Symbolic names looks very useful here.  But can we take a step back
> to make this whole printk much more useful, something like:
> 
> XFS (sda): Forced shutdown (log I/O error) at fs/xfs/xfs_trans.c:385 (xfs_trans_mod_sb+0x25).
> 
> That is print the reason as a string, and mke the whole thing less
> verbose and more readable.

Um, we /do/ log the error already; a full shutdown report looks like:

XFS (sda): xfs_do_force_shutdown(0x2) called from line 2440 of file
	fs/xfs/xfs_log.c. Return address = xfs_trans_mod_sb+0x25
XFS (sda): Corruption of in-memory data detected.  Shutting down
	filesystem

Or are you saying that we should combine them into a single message?

XFS (sda): Corruption of in-memory data detected at xlog_write+0x10
	(fs/xfs/xfs_log.c:2440).  Shutting down filesystem.

XFS (sda): Log I/O error detected at xlog_write+0x10
	(fs/xfs/xfs_log.c:2440).  Shutting down filesystem.

XFS (sda): I/O error detected at xlog_write+0x10
	(fs/xfs/xfs_log.c:2440).  Shutting down filesystem.

etc?

--D




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux