From: Vyacheslav Dubeyko Subject: [PATCH 1/2] nilfs2: debug messages for log validation sequence investigation Add debug messages for log validation sequence investigation Signed-off-by: Vyacheslav Dubeyko --- fs/nilfs2/recovery.c | 6 ++++++ fs/nilfs2/super.c | 6 ++++++ fs/nilfs2/the_nilfs.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c index f1626f5..1e8b044 100644 --- a/fs/nilfs2/recovery.c +++ b/fs/nilfs2/recovery.c @@ -840,6 +840,12 @@ int nilfs_search_super_root(struct the_nilfs *nilfs, __breadahead(nilfs->ns_bdev, b++, nilfs->ns_blocksize); for (;;) { + + + pr_debug("NILFS: pseg_start %ld, seg_seq %lld\n", pseg_start, seg_seq); + pr_debug("NILFS: cno %lld, segnum %lld\n", cno, segnum); + pr_debug("NILFS: nextnum %lld\n", nextnum); + brelse(bh_sum); ret = NILFS_SEG_FAIL_IO; bh_sum = nilfs_read_log_header(nilfs, pseg_start, &sum); diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 3c991dc..c88cb7a 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -254,6 +254,10 @@ void nilfs_set_log_cursor(struct nilfs_super_block *sbp, nilfs_count_free_blocks(nilfs, &nfreeblocks); sbp->s_free_blocks_count = cpu_to_le64(nfreeblocks); + pr_debug("NILFS: nilfs_set_log_cursor\n"); + pr_debug("NILFS: nilfs->ns_last_cno: %lld\n", nilfs->ns_last_cno); + pr_debug("NILFS: nilfs->ns_last_pseg: %lld\n", nilfs->ns_last_pseg); + spin_lock(&nilfs->ns_last_segment_lock); sbp->s_last_seq = cpu_to_le64(nilfs->ns_last_seq); sbp->s_last_pseg = cpu_to_le64(nilfs->ns_last_pseg); @@ -294,6 +298,8 @@ int nilfs_commit_super(struct super_block *sb, int flag) struct nilfs_super_block **sbp = nilfs->ns_sbp; time_t t; + pr_debug("NILFS: nilfs_commit_super: sb %#x, flags %x\n", sb, flag); + /* nilfs->ns_sem must be locked by the caller. */ t = get_seconds(); nilfs->ns_sbwtime = t; diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 41e6a04..ceeaf9b 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c @@ -475,6 +475,12 @@ void nilfs_swap_super_block(struct the_nilfs *nilfs) struct buffer_head *tsbh = nilfs->ns_sbh[0]; struct nilfs_super_block *tsbp = nilfs->ns_sbp[0]; + pr_debug("NILFS: swap superblocks\n"); + pr_debug("NILFS: nilfs->ns_sbp[0]->s_last_cno: %lld\n", le64_to_cpu(nilfs->ns_sbp[0]->s_last_cno)); + pr_debug("NILFS: nilfs->ns_sbp[0]->s_last_pseg: %lld\n", le64_to_cpu(nilfs->ns_sbp[0]->s_last_pseg)); + pr_debug("NILFS: nilfs->ns_sbp[1]->s_last_cno: %lld\n", le64_to_cpu(nilfs->ns_sbp[1]->s_last_cno)); + pr_debug("NILFS: nilfs->ns_sbp[1]->s_last_pseg: %lld\n", le64_to_cpu(nilfs->ns_sbp[1]->s_last_pseg)); + nilfs->ns_sbh[0] = nilfs->ns_sbh[1]; nilfs->ns_sbp[0] = nilfs->ns_sbp[1]; nilfs->ns_sbh[1] = tsbh; -- 1.7.9.5