From 26476dbefd325845b468ca5ecae01388489fb8f7 Mon Sep 17 00:00:00 2001 From: Andrew Price Date: Jan 12 2022 18:55:30 +0000 Subject: libgfs2: Move debugging printf out of build_root() mkfs.gfs2 is the only place it could ever get printed so move it there instead. Signed-off-by: Andrew Price --- diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c index 6cc0a8d..7ac38f9 100644 --- a/gfs2/libgfs2/structures.c +++ b/gfs2/libgfs2/structures.c @@ -450,10 +450,6 @@ int build_root(struct gfs2_sbd *sdp) if (sdp->md.rooti == NULL) return -1; - if (cfg_debug) { - printf("\nRoot directory:\n"); - lgfs2_dinode_print(bh->b_data); - } sdp->md.rooti->bh_owned = 1; return 0; } diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c index 56a3b7d..9a73ff7 100644 --- a/gfs2/mkfs/main_mkfs.c +++ b/gfs2/mkfs/main_mkfs.c @@ -1343,6 +1343,10 @@ int main(int argc, char *argv[]) printf("%s", _("Done\n")); build_root(&sbd); + if (opts.debug) { + printf("\nRoot directory:\n"); + lgfs2_dinode_print(sbd.md.rooti->i_bh->b_data); + } sbd.sd_root_dir = sbd.md.rooti->i_num; strncpy(sbd.sd_lockproto, opts.lockproto, GFS2_LOCKNAME_LEN - 1);