Skip to content

Commit

Permalink
f2fs-tools: adjust nat and block release logic
Browse files Browse the repository at this point in the history
Fixes: 0f503e4 ("f2fs-tools: do not reuse corrupted quota inodes")
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Daeho Jeong authored and Jaegeuk Kim committed Nov 28, 2023
1 parent 444c048 commit 68abdf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fsck/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -3094,10 +3094,13 @@ static void fsck_disconnect_file(struct f2fs_sb_info *sbi, nid_t ino,
release_block_cnt(sbi, dealloc);
get_node_info(sbi, nid, &ni);
release_block(sbi, ni.blk_addr, dealloc);

if (dealloc)
release_nat_entry(sbi, nid);
}

/* clear data counters */
if(!(node->i.i_inline & F2FS_INLINE_DATA)) {
if (!(node->i.i_inline & (F2FS_INLINE_DATA | F2FS_INLINE_DENTRY))) {
ofs = get_extra_isize(node);
for (i = 0; i < ADDRS_PER_INODE(&node->i); i++) {
block_t addr = le32_to_cpu(node->i.i_addr[ofs + i]);
Expand Down

0 comments on commit 68abdf3

Please sign in to comment.