Skip to contentSkip to conversation

gfs2_edit: mark log headers with the unmounted flag

PATCH New Bob Peterson 2 participants 3 messages Mar 3, 2014 – Mar 7, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 gfs2_edit: mark log headers with the unmounted flag

Hi,

This patch prints out "[UNMOUNTED]" next to log headers that have the unmounted flag set. That makes it much easier to determine the active part of a journal.

Regards,

Bob Peterson
Red Hat File Systems

---

gfs2/edit/journal.c +5 -2
index 118d068..4dab61c 100644
@@ -573,10 +573,13 @@ void dump_journal(const char *journal, int tblk)
 				check_journal_wrap(lh.lh_sequence,
 						   &highest_seq);
 				print_gfs2("0x%llx (j+%4llx): Log header: Seq"
-					   ": 0x%x, tail: 0x%x, blk: 0x%x",
+					   ": 0x%x, 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_tail, lh.lh_blkno,
+					   lh.lh_flags ==
+					   GFS2_LOG_HEAD_UNMOUNT ?
+					   " [UNMOUNTED]" : "");
 			}
 			eol(0);
 		} else if (sbd.gfs1 && ld_blocks > 0) {
#2 lore raw

PATCH 1/1 gfs2_edit: mark log headers with the unmounted flag

Hi Bob,

Quoted 5 lines · Bob Peterson

Hi,

This patch prints out "[UNMOUNTED]" next to log headers that have the unmounted flag set. That makes it much easier to determine the active part of a journal.

Looks good to me.

Cheers,
Andy

Quoted 29 lines

Regards,

Bob Peterson
Red Hat File Systems

---

gfs2/edit/journal.c +5 -2
index 118d068..4dab61c 100644
@@ -573,10 +573,13 @@ void dump_journal(const char *journal, int tblk)
  				check_journal_wrap(lh.lh_sequence,
  						   &highest_seq);
  				print_gfs2("0x%llx (j+%4llx): Log header: Seq"
-					   ": 0x%x, tail: 0x%x, blk: 0x%x",
+					   ": 0x%x, 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_tail, lh.lh_blkno,
+					   lh.lh_flags ==
+					   GFS2_LOG_HEAD_UNMOUNT ?
+					   " [UNMOUNTED]" : "");
  			}
  			eol(0);
  		} else if (sbd.gfs1 && ld_blocks > 0) {
#3 lore raw

PATCH 1/1 gfs2_edit: mark log headers with the unmounted flag

In reply to Bob Peterson
Quoted 6 lines · Bob Peterson

Hi,

This patch prints out "[UNMOUNTED]" next to log headers that have the unmounted flag set. That makes it much easier to determine the active part of a journal.

Quoted 6 lines

Regards,

Bob Peterson
Red Hat File Systems

This is now in gfs2-utils.git/master

Cheers,
Andy

Quoted 22 lines

---

gfs2/edit/journal.c +5 -2
index 118d068..4dab61c 100644
@@ -573,10 +573,13 @@ void dump_journal(const char *journal, int tblk)
  				check_journal_wrap(lh.lh_sequence,
  						   &highest_seq);
  				print_gfs2("0x%llx (j+%4llx): Log header: Seq"
-					   ": 0x%x, tail: 0x%x, blk: 0x%x",
+					   ": 0x%x, 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_tail, lh.lh_blkno,
+					   lh.lh_flags ==
+					   GFS2_LOG_HEAD_UNMOUNT ?
+					   " [UNMOUNTED]" : "");
  			}
  			eol(0);
  		} else if (sbd.gfs1 && ld_blocks > 0) {