@@ -1016,6 +1016,8 @@ static int copy_inode_item(struct btrfs_inode_item *dst,
struct ext2_inode *src, u32 blocksize)
{
btrfs_set_stack_inode_generation(dst, 1);
+ btrfs_set_stack_inode_sequence(dst, 0);
+ btrfs_set_stack_inode_transid(dst, 1);
btrfs_set_stack_inode_size(dst, src->i_size);
btrfs_set_stack_inode_nbytes(dst, 0);
btrfs_set_stack_inode_block_group(dst, 0);
@@ -1052,6 +1054,8 @@ static int copy_inode_item(struct btrfs_inode_item *dst,
new_decode_dev(src->i_block[1]));
}
}
+ memset(&dst->reserved, 0, sizeof(dst->reserved));
+
return 0;
}
@@ -1424,6 +1424,8 @@ BTRFS_SETGET_STACK_FUNCS(stack_inode_generation,
struct btrfs_inode_item, generation, 64);
BTRFS_SETGET_STACK_FUNCS(stack_inode_sequence,
struct btrfs_inode_item, sequence, 64);
+BTRFS_SETGET_STACK_FUNCS(stack_inode_transid,
+ struct btrfs_inode_item, transid, 64);
BTRFS_SETGET_STACK_FUNCS(stack_inode_size,
struct btrfs_inode_item, size, 64);
BTRFS_SETGET_STACK_FUNCS(stack_inode_nbytes,
sequence, transid and reserved field of inode was write to disk with uninitizlized value, this patch fixed it. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> --- btrfs-convert.c | 4 ++++ ctree.h | 2 ++ 2 files changed, 6 insertions(+)