commit 524dca1221b851159bf45a702f111bd8952036d7 Author: Bob Peterson <rpeterso@redhat.com> Date: Wed Feb 2 13:29:22 2011 -0600 gfs2_edit: has problems printing gfs1 journals The gfs2_edit tool was releasing the buffer too soon while printing out journals. It worked for gfs2 journals, but not for gfs1 journals. This patch moves the buffer release later in the function so that gfs1 journals will print correctly. rhbz#656371 diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index 6b92390..5432fa2 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -2038,7 +2038,6 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size) if (!gfs1) do_dinode_extended(&di, jindex_bh); /* parse dir. */ - brelse(jindex_bh); if (gfs1) { struct gfs2_inode *jiinode; @@ -2063,6 +2062,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size) *j_size = jdi.di_size; brelse(j_bh); } + brelse(jindex_bh); return jblock; }