diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-10-18 23:49:30 -0700 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2014-11-07 15:32:19 -0800 |
commit | e90e81703d3245e14d90fcb1bdb5a6c6cdd6393e (patch) | |
tree | 6fae2f232018f4a3fd74abedb7d7d7a72f7cc0cc | |
parent | df2501e140764a8b67fc22388985359836760a0b (diff) | |
download | android_external_f2fs-tools-e90e81703d3245e14d90fcb1bdb5a6c6cdd6393e.tar.gz android_external_f2fs-tools-e90e81703d3245e14d90fcb1bdb5a6c6cdd6393e.tar.bz2 android_external_f2fs-tools-e90e81703d3245e14d90fcb1bdb5a6c6cdd6393e.zip |
fsck.f2fs: fix wrongly allocated 0'th block for inline_data
This patch fixes not to allocate any 0'th block for inline_data.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/fsck.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c index 63fe998..21dde87 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -394,11 +394,20 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid, if (ftype == F2FS_FT_CHRDEV || ftype == F2FS_FT_BLKDEV || ftype == F2FS_FT_FIFO || ftype == F2FS_FT_SOCK) goto check; - if((node_blk->i.i_inline & F2FS_INLINE_DATA)){ + + if((node_blk->i.i_inline & F2FS_INLINE_DATA)) { + if (le32_to_cpu(node_blk->i.i_addr[0]) != 0) { + /* should fix this bug all the time */ + FIX_MSG("inline_data has wrong 0'th block = %x", + le32_to_cpu(node_blk->i.i_addr[0])); + node_blk->i.i_addr[0] = 0; + node_blk->i.i_blocks = cpu_to_le64(*blk_cnt); + need_fix = 1; + } DBG(3, "ino[0x%x] has inline data!\n", nid); goto check; } - if((node_blk->i.i_inline & F2FS_INLINE_DENTRY)){ + if((node_blk->i.i_inline & F2FS_INLINE_DENTRY)) { DBG(3, "ino[0x%x] has inline dentry!\n", nid); ret = fsck_chk_inline_dentries(sbi, node_blk, &child_cnt, &child_files); |