fsck.f2fs: fix DATA_EXIST flag for old partition

This should fix the DATA_EXIST before recent inline_data is enabled.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2014-10-31 11:06:45 -07:00
parent 056e4b04fc
commit 7279f0383c
2 changed files with 12 additions and 0 deletions

View File

@ -404,6 +404,17 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
node_blk->i.i_blocks = cpu_to_le64(*blk_cnt);
need_fix = 1;
}
if (!(node_blk->i.i_inline & F2FS_DATA_EXIST)) {
char buf[MAX_INLINE_DATA];
memset(buf, 0, MAX_INLINE_DATA);
if (memcmp(buf, &node_blk->i.i_addr[1],
MAX_INLINE_DATA)) {
FIX_MSG("inline_data has DATA_EXIST");
node_blk->i.i_inline |= F2FS_DATA_EXIST;
need_fix = 1;
}
}
DBG(3, "ino[0x%x] has inline data!\n", nid);
goto check;
}

View File

@ -426,6 +426,7 @@ struct f2fs_extent {
#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */
#define F2FS_INLINE_DATA 0x02 /* file inline data flag */
#define F2FS_INLINE_DENTRY 0x04 /* file inline dentry flag */
#define F2FS_DATA_EXIST 0x08 /* file inline data exist flag */
#define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \
F2FS_INLINE_XATTR_ADDRS - 1))