Skip to content

Commit 4b9b151

Browse files
authored
Merge pull request #139 from iaoing/issue_136
Fix epoch_id issue, #136
2 parents b817ca3 + 4e5dbe6 commit 4b9b151

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/nova/snapshot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ int nova_restore_snapshot_entry(struct super_block *sb,
866866
goto out;
867867
}
868868

869-
if (epoch_id > sbi->s_epoch_id)
870-
sbi->s_epoch_id = epoch_id;
869+
if (epoch_id >= sbi->s_epoch_id)
870+
sbi->s_epoch_id = epoch_id + 1;
871871

872872
out:
873873
nova_clear_nvmm_page(sb, entry, just_init);
@@ -963,7 +963,7 @@ int nova_create_snapshot(struct super_block *sb)
963963
nova_set_vmas_readonly(sb);
964964

965965
sbi->nova_sb->s_wtime = cpu_to_le32(get_seconds());
966-
sbi->nova_sb->s_epoch_id = cpu_to_le64(epoch_id);
966+
sbi->nova_sb->s_epoch_id = cpu_to_le64(epoch_id + 1);
967967
nova_update_super_crc(sb);
968968

969969
nova_sync_super(sb);

0 commit comments

Comments
 (0)