* [PATCH] fsck.f2fs: avoid wrong IS_VALID_BLK_ADDR
@ 2017-12-28 2:21 Jaegeuk Kim
2017-12-29 7:59 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Jaegeuk Kim @ 2017-12-28 2:21 UTC (permalink / raw)
To: linux-f2fs-devel; +Cc: Jaegeuk Kim
This patch avoids to check next free block offset in current segments, since we
are using IS_VALID_BLK_ADDR during fsck which is able to be valid for a while.
Let's just check this at the end of fsck.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fsck/f2fs.h | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/fsck/f2fs.h b/fsck/f2fs.h
index 34b2481..b7b6305 100644
--- a/fsck/f2fs.h
+++ b/fsck/f2fs.h
@@ -369,21 +369,12 @@ static inline bool IS_VALID_NID(struct f2fs_sb_info *sbi, u32 nid)
static inline bool IS_VALID_BLK_ADDR(struct f2fs_sb_info *sbi, u32 addr)
{
- int i;
-
if (addr >= le64_to_cpu(F2FS_RAW_SUPER(sbi)->block_count) ||
addr < SM_I(sbi)->main_blkaddr) {
DBG(1, "block addr [0x%x]\n", addr);
return 0;
}
-
- for (i = 0; i < NO_CHECK_TYPE; i++) {
- struct curseg_info *curseg = CURSEG_I(sbi, i);
-
- if (START_BLOCK(sbi, curseg->segno) +
- curseg->next_blkoff == addr)
- return 0;
- }
+ /* next block offset will be checked at the end of fsck. */
return 1;
}
--
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] 2+ messages in thread
* Re: [PATCH] fsck.f2fs: avoid wrong IS_VALID_BLK_ADDR
2017-12-28 2:21 [PATCH] fsck.f2fs: avoid wrong IS_VALID_BLK_ADDR Jaegeuk Kim
@ 2017-12-29 7:59 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2017-12-29 7:59 UTC (permalink / raw)
To: Jaegeuk Kim, linux-f2fs-devel
On 2017/12/28 10:21, Jaegeuk Kim wrote:
> This patch avoids to check next free block offset in current segments, since we
> are using IS_VALID_BLK_ADDR during fsck which is able to be valid for a while.
> Let's just check this at the end of fsck.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
------------------------------------------------------------------------------
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 [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-29 7:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-28 2:21 [PATCH] fsck.f2fs: avoid wrong IS_VALID_BLK_ADDR Jaegeuk Kim
2017-12-29 7:59 ` 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).