From 1bc76585d5cb1dadcd6b84c18d4ea911ab0e12e7 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 13 Jul 2021 16:15:35 -0700 Subject: [PATCH] dump.f2fs: minor clean ups This patch cleans up, pointed by Chao. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fsck/dump.c | 3 +-- fsck/fsck.c | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 67e94ed..fce86c9 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -256,8 +256,7 @@ static void dump_data_blk(struct f2fs_sb_info *sbi, __u64 offset, u32 blkaddr) ASSERT(blkaddr == NULL_ADDR); return; } - if (blkaddr == NULL_ADDR || blkaddr == NEW_ADDR || - blkaddr == COMPRESS_ADDR) { + if (!is_valid_data_blkaddr(blkaddr)) { print_extent(false); dump_extent.blk = 0; dump_extent.len = 1; diff --git a/fsck/fsck.c b/fsck/fsck.c index 6ca85f0..279b2c4 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -1722,6 +1722,7 @@ int fsck_chk_dentry_blk(struct f2fs_sb_info *sbi, int casefolded, u32 blk_addr, fsck->dentry_depth++; new_dentry = calloc(sizeof(struct f2fs_dentry), 1); + ASSERT(new_dentry != NULL); new_dentry->depth = fsck->dentry_depth; memcpy(new_dentry->name, child->p_name, F2FS_NAME_LEN); cur_dentry->next = new_dentry;