diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-09 00:11:23 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-09 00:11:23 +0000 |
commit | 6338a48f79eb3f8fcc592aa65dc873f81e556163 (patch) | |
tree | 391fdaa092b2a41db3d979d6b376739ece6316a8 | |
parent | 776f186654a4d1e1c831ec8fbc51a80c59987cec (diff) | |
parent | 6b20b0d6788b4e7241c3acad1560d8eaad80b319 (diff) | |
download | android_external_f2fs-tools-6338a48f79eb3f8fcc592aa65dc873f81e556163.tar.gz android_external_f2fs-tools-6338a48f79eb3f8fcc592aa65dc873f81e556163.tar.bz2 android_external_f2fs-tools-6338a48f79eb3f8fcc592aa65dc873f81e556163.zip |
am 6b20b0d6: fsck.f2fs: remove dentry if its inode block is corrupted
* commit '6b20b0d6788b4e7241c3acad1560d8eaad80b319':
fsck.f2fs: remove dentry if its inode block is corrupted
-rw-r--r-- | fsck/fsck.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c index 00f5b27..2a47b4c 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -617,8 +617,21 @@ int fsck_chk_dentry_blk(struct f2fs_sb_info *sbi, u32 blk_addr, TYPE_INODE, &blk_cnt); - if (ret) - printf("TODO: delete dentry\n"); + if (ret && config.fix_cnt) { + int j; + int slots = (name_len + F2FS_SLOT_LEN - 1) / + F2FS_SLOT_LEN; + for (j = 0; j < slots; j++) + clear_bit(i + j, + (unsigned long *)de_blk->dentry_bitmap); + FIX_MSG("Unlink [0x%x] - %s len[0x%x], type[0x%x]", + le32_to_cpu(de_blk->dentry[i].ino), + name, name_len, + de_blk->dentry[i].file_type); + i += slots; + free(name); + continue; + } i += (name_len + F2FS_SLOT_LEN - 1) / F2FS_SLOT_LEN; dentries++; |