From 24d78dd64e3a248b940154741e9553ab21bcfa91 Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Sat, 1 May 2010 11:54:21 +0900 Subject: [PATCH] --- yaml --- r: 196022 b: refs/heads/master c: 25294d8c376296b1420694317e9856eaaea710ca h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nilfs2/the_nilfs.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index a9acd66ff9c3..a488a9f724ef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 34cb9b5c973ac06449b96884be932da9a9b99819 +refs/heads/master: 25294d8c376296b1420694317e9856eaaea710ca diff --git a/trunk/fs/nilfs2/the_nilfs.c b/trunk/fs/nilfs2/the_nilfs.c index 33871f7e4f01..a756168a21c2 100644 --- a/trunk/fs/nilfs2/the_nilfs.c +++ b/trunk/fs/nilfs2/the_nilfs.c @@ -486,11 +486,15 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs, printk(KERN_WARNING "NILFS warning: unable to read secondary superblock\n"); + /* + * Compare two super blocks and set 1 in swp if the secondary + * super block is valid and newer. Otherwise, set 0 in swp. + */ valid[0] = nilfs_valid_sb(sbp[0]); valid[1] = nilfs_valid_sb(sbp[1]); - swp = valid[1] && - (!valid[0] || - le64_to_cpu(sbp[1]->s_wtime) > le64_to_cpu(sbp[0]->s_wtime)); + swp = valid[1] && (!valid[0] || + le64_to_cpu(sbp[1]->s_last_cno) > + le64_to_cpu(sbp[0]->s_last_cno)); if (valid[swp] && nilfs_sb2_bad_offset(sbp[swp], sb2off)) { brelse(sbh[1]);