@@ -2022,9 +2022,15 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline)
20222022
20232023int ext4_convert_inline_data (struct inode * inode )
20242024{
2025+ struct ext4_xattr_ibody_find is = {
2026+ .s = { .not_found = - ENODATA , },
2027+ };
2028+ struct ext4_xattr_info i = {
2029+ .name_index = EXT4_XATTR_INDEX_SYSTEM ,
2030+ .name = EXT4_XATTR_SYSTEM_DATA ,
2031+ };
20252032 int error , needed_blocks , no_expand ;
20262033 handle_t * handle ;
2027- struct ext4_iloc iloc ;
20282034
20292035 if (!ext4_has_inline_data (inode )) {
20302036 ext4_clear_inode_state (inode , EXT4_STATE_MAY_INLINE_DATA );
@@ -2045,8 +2051,8 @@ int ext4_convert_inline_data(struct inode *inode)
20452051
20462052 needed_blocks = ext4_writepage_trans_blocks (inode );
20472053
2048- iloc .bh = NULL ;
2049- error = ext4_get_inode_loc (inode , & iloc );
2054+ is . iloc .bh = NULL ;
2055+ error = ext4_get_inode_loc (inode , & is . iloc );
20502056 if (error )
20512057 return error ;
20522058
@@ -2057,11 +2063,17 @@ int ext4_convert_inline_data(struct inode *inode)
20572063 }
20582064
20592065 ext4_write_lock_xattr (inode , & no_expand );
2066+
2067+ error = ext4_xattr_ibody_find (inode , & i , & is );
2068+ if (error )
2069+ goto out_xattr ;
2070+
20602071 if (ext4_has_inline_data (inode ))
2061- error = ext4_convert_inline_data_nolock (handle , inode , & iloc );
2072+ error = ext4_convert_inline_data_nolock (handle , inode , & is .iloc );
2073+ out_xattr :
20622074 ext4_write_unlock_xattr (inode , & no_expand );
20632075 ext4_journal_stop (handle );
20642076out_free :
2065- brelse (iloc .bh );
2077+ brelse (is . iloc .bh );
20662078 return error ;
20672079}
0 commit comments