All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: print buffer offsets when dumping corrupt buffers
@ 2018-10-31 15:47 Darrick J. Wong
  2018-11-01 21:38 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2018-10-31 15:47 UTC (permalink / raw)
  To: xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Use DUMP_PREFIX_OFFSET when printing hex dumps of corrupt buffers
because modern Linux now prints a 32-bit hash of our 64-bit pointer when
using DUMP_PREFIX_ADDRESS:

00000000b4bb4297: 00 00 00 00 00 00 00 00 3b ee 00 00 00 00 00 00  ........;.......
00000005ec77e26: 00 00 00 00 02 d0 5a 00 00 00 00 00 00 00 00 00  ......Z.........
000000015938018: 21 98 e8 b4 fd de 4c 07 bc ea 3c e5 ae b4 7c 48  !.....L...<...|H

This is totally worthless for a sequential dump since we probably only
care about tracking the buffer offsets and afaik there's no way to
recover the actual pointer from the hashed value.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_message.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_message.c b/fs/xfs/xfs_message.c
index 576c375ce12a..6b736ea58d35 100644
--- a/fs/xfs/xfs_message.c
+++ b/fs/xfs/xfs_message.c
@@ -107,5 +107,5 @@ assfail(char *expr, char *file, int line)
 void
 xfs_hex_dump(void *p, int length)
 {
-	print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_ADDRESS, 16, 1, p, length, 1);
+	print_hex_dump(KERN_ALERT, "", DUMP_PREFIX_OFFSET, 16, 1, p, length, 1);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: print buffer offsets when dumping corrupt buffers
  2018-10-31 15:47 [PATCH] xfs: print buffer offsets when dumping corrupt buffers Darrick J. Wong
@ 2018-11-01 21:38 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2018-11-01 21:38 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs

On Wed, Oct 31, 2018 at 08:47:10AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Use DUMP_PREFIX_OFFSET when printing hex dumps of corrupt buffers
> because modern Linux now prints a 32-bit hash of our 64-bit pointer when
> using DUMP_PREFIX_ADDRESS:
> 
> 00000000b4bb4297: 00 00 00 00 00 00 00 00 3b ee 00 00 00 00 00 00  ........;.......
> 00000005ec77e26: 00 00 00 00 02 d0 5a 00 00 00 00 00 00 00 00 00  ......Z.........
> 000000015938018: 21 98 e8 b4 fd de 4c 07 bc ea 3c e5 ae b4 7c 48  !.....L...<...|H
> 
> This is totally worthless for a sequential dump since we probably only
> care about tracking the buffer offsets and afaik there's no way to
> recover the actual pointer from the hashed value.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Makes sense - offset into buffer is what we really care about.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-02  6:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 15:47 [PATCH] xfs: print buffer offsets when dumping corrupt buffers Darrick J. Wong
2018-11-01 21:38 ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.