Unverified Commit 9233a70f authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11390 hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode()

parents 572bcd80 53cef7dc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t
	HFS_I(inode)->flags = 0;
	HFS_I(inode)->rsrc_inode = NULL;
	HFS_I(inode)->fs_blocks = 0;
	HFS_I(inode)->tz_secondswest = sys_tz.tz_minuteswest * 60;
	if (S_ISDIR(mode)) {
		inode->i_size = 2;
		HFS_SB(sb)->folder_count++;
@@ -275,6 +276,8 @@ void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext,
	for (count = 0, i = 0; i < 3; i++)
		count += be16_to_cpu(ext[i].count);
	HFS_I(inode)->first_blocks = count;
	HFS_I(inode)->cached_start = 0;
	HFS_I(inode)->cached_blocks = 0;

	inode->i_size = HFS_I(inode)->phys_size = log_size;
	HFS_I(inode)->fs_blocks = (log_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits;