All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint
@ 2018-01-20  4:26 ` Jaegeuk Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Jaegeuk Kim @ 2018-01-20  4:26 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim

If fsck.f2fs changes crc, we have no way to recover some inode blocks by roll-
forward recovery. Let's relax the condition to recover them.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/node.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
index 0ee3e5ff49a3..15280eeb24ea 100644
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -305,10 +305,11 @@ static inline bool is_recoverable_dnode(struct page *page)
 	struct f2fs_checkpoint *ckpt = F2FS_CKPT(F2FS_P_SB(page));
 	__u64 cp_ver = cur_cp_version(ckpt);
 
-	if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG))
+	if (__is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG)) {
 		cp_ver |= (cur_cp_crc(ckpt) << 32);
-
-	return cp_ver == cpver_of_node(page);
+		return cp_ver == cpver_of_node(page);
+	}
+	return (cp_ver << 32) == (cpver_of_node(page) << 32);
 }
 
 /*
-- 
2.15.0.531.g2ccb3012c9-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-01-21  2:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-20  4:26 [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint Jaegeuk Kim
2018-01-20  4:26 ` Jaegeuk Kim
2018-01-20  4:26 ` [PATCH 2/2] f2fs: recover some i_inline flags Jaegeuk Kim
2018-01-20  4:26   ` Jaegeuk Kim
2018-01-20  9:33   ` Chao Yu
2018-01-20  9:33     ` [f2fs-dev] " Chao Yu
2018-01-20 22:06   ` [PATCH 2/2 v2] " Jaegeuk Kim
2018-01-20 22:06     ` Jaegeuk Kim
2018-01-21  2:42     ` Chao Yu
2018-01-21  2:42       ` [f2fs-dev] " Chao Yu
2018-01-20  9:29 ` [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint Chao Yu
2018-01-20  9:29   ` [f2fs-dev] " Chao Yu
2018-01-20 22:05 ` [PATCH 1/2 v2] " Jaegeuk Kim
2018-01-20 22:05   ` Jaegeuk Kim
2018-01-21  2:41   ` Chao Yu
2018-01-21  2:41     ` [f2fs-dev] " Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.