From: Dave Chinner Date: Thu, 9 May 2013 12:11:50 +0000 (-0500) Subject: xfs_logprint: print all AGI unlinked buckets X-Git-Tag: v3.2.0-alpha1~143 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a59111c1fc89a8bb5bd1030efce8b75f583e9b1e;p=thirdparty%2Fxfsprogs-dev.git xfs_logprint: print all AGI unlinked buckets When printing buffer contents, the AGI unlinked buckets are not printed in transactional output. In normal dump format, they are printed, but that format is generally not useful for log recovery analysis. Add the same code to the transactional buffer dump. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Mark Tinguely Signed-off-by: Rich Johnston --- diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c index 69d6e719c..2c45ff290 100644 --- a/logprint/log_print_all.c +++ b/logprint/log_print_all.c @@ -122,6 +122,7 @@ xlog_recover_print_buffer( be32_to_cpu(*(__be32 *)(p+56)), be32_to_cpu(*(__be32 *)(p+60))); } else if (be32_to_cpu(*(__be32 *)p) == XFS_AGI_MAGIC) { + int bucket, buckets; agi = (xfs_agi_t *)p; printf(_(" AGI Buffer: (XAGI)\n")); if (!print_buffer) @@ -137,6 +138,24 @@ xlog_recover_print_buffer( be32_to_cpu(agi->agi_level), be32_to_cpu(agi->agi_freecount), be32_to_cpu(agi->agi_newino)); + if (len == 128) { + buckets = 17; + } else if (len == 256) { + buckets = 32 + 17; + } else { + buckets = XFS_AGI_UNLINKED_BUCKETS; + } + for (bucket = 0; bucket < buckets;) { + int col; + printf(_("bucket[%d - %d]: "), bucket, bucket+3); + for (col = 0; col < 4; col++, bucket++) { + if (bucket < buckets) { + printf("0x%x ", + be32_to_cpu(agi->agi_unlinked[bucket])); + } + } + printf("\n"); + } } else if (be32_to_cpu(*(__be32 *)p) == XFS_AGF_MAGIC) { agf = (xfs_agf_t *)p; printf(_(" AGF Buffer: (XAGF)\n"));