This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit e03f156edb8c5bc5cab3e0b9fc5ee969e2489db2
Author: Andreas Gruenbacher <agruenba(a)redhat.com>
AuthorDate: Mon Mar 25 23:13:25 2019 +0000
gfs2edit: journal dump: decode lh_flags
When dumping a journal with "gfs2_edit -p journalX, decode the lh_flags
field of log headers.
---
gfs2/edit/journal.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 559bd4e..6364761 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -476,6 +476,8 @@ static uint64_t get_ldref(uint64_t abs_ld, int offset_from_ld)
*/
void dump_journal(const char *journal, int tblk)
{
+ const struct lgfs2_metadata *mtype;
+ const struct lgfs2_metafield *lh_flags_field;
struct gfs2_buffer_head *j_bh = NULL, dummy_bh;
uint64_t jblock, j_size, jb, abs_block, saveblk, wrappt = 0;
int start_line, journal_num;
@@ -487,6 +489,9 @@ void dump_journal(const char *journal, int tblk)
struct rgrp_tree *rgd = NULL;
uint64_t abs_ld = 0;
+ mtype = lgfs2_find_mtype(GFS2_METATYPE_LH, sbd.gfs1 ? LGFS2_MD_GFS1 : LGFS2_MD_GFS2);
+ lh_flags_field = lgfs2_find_mfield_name("lh_flags", mtype);
+
start_line = line;
lines_per_row[dmode] = 1;
journal_num = atoi(journal + 7);
@@ -593,17 +598,20 @@ void dump_journal(const char *journal, int tblk)
lh1.lh_first, lh1.lh_tail,
lh1.lh_last_dump);
} else {
+ char flags_str[256];
+
gfs2_log_header_in(&lh, dummy_bh.b_data);
check_journal_wrap(lh.lh_sequence,
&highest_seq);
+ lgfs2_field_str(flags_str, sizeof(flags_str),
+ dummy_bh.b_data, lh_flags_field,
+ (dmode == HEX_MODE));
print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log header:
Seq"
- ": 0x%llx, tail: 0x%x, blk: 0x%x%s",
+ ": 0x%llx, tail: 0x%x, blk: 0x%x [%s]",
abs_block, ((jb + wrappt) % j_size)
/ sbd.bsize, lh.lh_sequence,
lh.lh_tail, lh.lh_blkno,
- lh.lh_flags ==
- GFS2_LOG_HEAD_UNMOUNT ?
- " [UNMOUNTED]" : "");
+ flags_str);
}
eol(0);
} else if ((ld_blocks > 0) &&
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date