mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
synced 2024-11-27 11:43:36 +08:00
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:
parent
056e4b04fc
commit
7279f0383c
11
fsck/fsck.c
11
fsck/fsck.c
@ -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;
|
||||
}
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user