From: Donald Douwsma <ddouwsma@redhat.com>
To: linux-xfs@vger.kernel.org
Cc: Donald Douwsma <ddouwsma@redhat.com>
Subject: [PATCH 1/2] xfs_logprint: print misc buffers when using -o
Date: Thu, 28 Jan 2021 18:37:07 +1100 [thread overview]
Message-ID: <20210128073708.25572-2-ddouwsma@redhat.com> (raw)
In-Reply-To: <20210128073708.25572-1-ddouwsma@redhat.com>
Logprint only dumps raw buffers for unhandled misc buffer types, but
this information is generally useful when debugging logprint issues so
allow it to print whenever -o is used.
Switch to using the common xlog_print_data function to dump the buffer.
Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
---
logprint/log_misc.c | 19 +++----------------
logprint/log_print_all.c | 2 +-
2 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/logprint/log_misc.c b/logprint/log_misc.c
index c325f046..d44e9ff7 100644
--- a/logprint/log_misc.c
+++ b/logprint/log_misc.c
@@ -392,23 +392,10 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
}
} else {
printf(_("BUF DATA\n"));
- if (print_data) {
- uint *dp = (uint *)*ptr;
- int nums = be32_to_cpu(head->oh_len) >> 2;
- int byte = 0;
-
- while (byte < nums) {
- if ((byte % 8) == 0)
- printf("%2x ", byte);
- printf("%8x ", *dp);
- dp++;
- byte++;
- if ((byte % 8) == 0)
- printf("\n");
- }
- printf("\n");
- }
}
+
+ xlog_recover_print_data(*ptr, be32_to_cpu(head->oh_len));
+
*ptr += be32_to_cpu(head->oh_len);
}
if (head && head->oh_flags & XLOG_CONTINUE_TRANS)
diff --git a/logprint/log_print_all.c b/logprint/log_print_all.c
index eafffe28..2b9e810d 100644
--- a/logprint/log_print_all.c
+++ b/logprint/log_print_all.c
@@ -176,8 +176,8 @@ xlog_recover_print_buffer(
} else {
printf(_(" BUF DATA\n"));
if (!print_buffer) continue;
- xlog_recover_print_data(p, len);
}
+ xlog_recover_print_data(p, len);
}
}
--
2.27.0
next prev parent reply other threads:[~2021-01-28 7:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-28 7:37 [PATCH 0/2] xfsprogs: xfs_logprint misc log decoding issues Donald Douwsma
2021-01-28 7:37 ` Donald Douwsma [this message]
2021-01-28 17:35 ` [PATCH 1/2] xfs_logprint: print misc buffers when using -o Darrick J. Wong
2021-01-28 21:51 ` Donald Douwsma
2021-01-28 7:37 ` [PATCH 2/2] xfs_logprint: decode superblock updates correctly Donald Douwsma
2021-01-28 17:28 ` Darrick J. Wong
2021-01-28 21:59 ` Donald Douwsma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210128073708.25572-2-ddouwsma@redhat.com \
--to=ddouwsma@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox