linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint
@ 2018-01-20  4:26 Jaegeuk Kim
  2018-01-20  4:26 ` [PATCH 2/2] f2fs: recover some i_inline flags Jaegeuk Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ 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

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

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

Thread overview: 8+ 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 ` [PATCH 2/2] f2fs: recover some i_inline flags Jaegeuk Kim
2018-01-20  9:33   ` [f2fs-dev] " Chao Yu
2018-01-20 22:06   ` [PATCH 2/2 v2] " Jaegeuk Kim
2018-01-21  2:42     ` [f2fs-dev] " Chao Yu
2018-01-20  9:29 ` [f2fs-dev] [PATCH 1/2] f2fs: allow to recover node blocks given updated checkpoint Chao Yu
2018-01-20 22:05 ` [PATCH 1/2 v2] " Jaegeuk Kim
2018-01-21  2:41   ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).