File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -6154,6 +6154,9 @@ static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
61546154 int status ;
61556155 struct inode * inode = NULL ;
61566156 struct buffer_head * bh = NULL ;
6157+ struct ocfs2_dinode * di ;
6158+ struct ocfs2_truncate_log * tl ;
6159+ unsigned int tl_count ;
61576160
61586161 inode = ocfs2_get_system_file_inode (osb ,
61596162 TRUNCATE_LOG_SYSTEM_INODE ,
@@ -6171,6 +6174,18 @@ static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
61716174 goto bail ;
61726175 }
61736176
6177+ di = (struct ocfs2_dinode * )bh -> b_data ;
6178+ tl = & di -> id2 .i_dealloc ;
6179+ tl_count = le16_to_cpu (tl -> tl_count );
6180+ if (unlikely (tl_count > ocfs2_truncate_recs_per_inode (osb -> sb ) ||
6181+ tl_count == 0 )) {
6182+ status = - EFSCORRUPTED ;
6183+ iput (inode );
6184+ brelse (bh );
6185+ mlog_errno (status );
6186+ goto bail ;
6187+ }
6188+
61746189 * tl_inode = inode ;
61756190 * tl_bh = bh ;
61766191bail :
You can’t perform that action at this time.
0 commit comments