* [Cluster-devel] [gfs2-utils PATCH] gfs2_edit: Log descriptor continuation blocks print wrong info
[not found] <890548415.9578388.1447353235641.JavaMail.zimbra@redhat.com>
@ 2015-11-12 18:35 ` Bob Peterson
2015-11-12 18:50 ` Andrew Price
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2015-11-12 18:35 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
This patch fixes a couple minor annoyances wrt the printing of
journal continuation blocks.
gfs2_edit: Log descriptor continuation blocks print wrong info
Log descriptor continuation blocks are printing misleading
information. First, the offset from the start of the journal is
reported incorrectly. Second, it's trying to print the block
types when it shouldn't. The faulty output looks like this:
0x40e9 (j+4093000): Log descriptor continuation block
0x48202b none 0x481e2d none 0x481c2f none 0x481a31 none
In practice, these are used to continue the job of "revoke" log
descriptors, which have no blocks that follow, so it should not
try to report the types of the blocks that follow.
This patch fixes the journal offset calculation and skips the
reporting of the block types that follow, so the output looks
is given correctly as:
0x40e9 (j+4093): Log descriptor continuation block
0x48202b 0x481e2d 0x481c2f 0x481a31
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 15e02de..80c8738 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -610,7 +610,8 @@ void dump_journal(const char *journal, int tblk)
} else if ((ld_blocks > 0) &&
(sbd.gfs1 || block_type == GFS2_METATYPE_LB)) {
print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log descriptor"
- " continuation block", abs_block, jb);
+ " continuation block", abs_block,
+ ((jb + wrappt) % j_size) / sbd.bsize);
eol(0);
print_gfs2(" ");
ld_blocks -= print_ld_blks((uint64_t *)dummy_bh.b_data +
@@ -619,7 +620,7 @@ void dump_journal(const char *journal, int tblk)
(dummy_bh.b_data +
sbd.bsize), start_line,
tblk, &tblk_off, 0, rgd,
- 0, 1, NULL, 1);
+ 0, 1, NULL, 0);
} else if (block_type == 0) {
continue;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [gfs2-utils PATCH] gfs2_edit: Log descriptor continuation blocks print wrong info
2015-11-12 18:35 ` [Cluster-devel] [gfs2-utils PATCH] gfs2_edit: Log descriptor continuation blocks print wrong info Bob Peterson
@ 2015-11-12 18:50 ` Andrew Price
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Price @ 2015-11-12 18:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
On 12/11/15 18:35, Bob Peterson wrote:
> Hi,
>
> This patch fixes a couple minor annoyances wrt the printing of
> journal continuation blocks.
>
> gfs2_edit: Log descriptor continuation blocks print wrong info
>
> Log descriptor continuation blocks are printing misleading
> information. First, the offset from the start of the journal is
> reported incorrectly. Second, it's trying to print the block
> types when it shouldn't. The faulty output looks like this:
> 0x40e9 (j+4093000): Log descriptor continuation block
> 0x48202b none 0x481e2d none 0x481c2f none 0x481a31 none
> In practice, these are used to continue the job of "revoke" log
> descriptors, which have no blocks that follow, so it should not
> try to report the types of the blocks that follow.
>
> This patch fixes the journal offset calculation and skips the
> reporting of the block types that follow, so the output looks
> is given correctly as:
> 0x40e9 (j+4093): Log descriptor continuation block
> 0x48202b 0x481e2d 0x481c2f 0x481a31
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Looks good to me.
Thanks,
Andy
> ---
> diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
> index 15e02de..80c8738 100644
> --- a/gfs2/edit/journal.c
> +++ b/gfs2/edit/journal.c
> @@ -610,7 +610,8 @@ void dump_journal(const char *journal, int tblk)
> } else if ((ld_blocks > 0) &&
> (sbd.gfs1 || block_type == GFS2_METATYPE_LB)) {
> print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log descriptor"
> - " continuation block", abs_block, jb);
> + " continuation block", abs_block,
> + ((jb + wrappt) % j_size) / sbd.bsize);
> eol(0);
> print_gfs2(" ");
> ld_blocks -= print_ld_blks((uint64_t *)dummy_bh.b_data +
> @@ -619,7 +620,7 @@ void dump_journal(const char *journal, int tblk)
> (dummy_bh.b_data +
> sbd.bsize), start_line,
> tblk, &tblk_off, 0, rgd,
> - 0, 1, NULL, 1);
> + 0, 1, NULL, 0);
> } else if (block_type == 0) {
> continue;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-12 18:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <890548415.9578388.1447353235641.JavaMail.zimbra@redhat.com>
2015-11-12 18:35 ` [Cluster-devel] [gfs2-utils PATCH] gfs2_edit: Log descriptor continuation blocks print wrong info Bob Peterson
2015-11-12 18:50 ` Andrew Price
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).