File tree 1 file changed +15
-0
lines changed
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,
6154
6154
int status ;
6155
6155
struct inode * inode = NULL ;
6156
6156
struct buffer_head * bh = NULL ;
6157
+ struct ocfs2_dinode * di ;
6158
+ struct ocfs2_truncate_log * tl ;
6159
+ unsigned int tl_count ;
6157
6160
6158
6161
inode = ocfs2_get_system_file_inode (osb ,
6159
6162
TRUNCATE_LOG_SYSTEM_INODE ,
@@ -6171,6 +6174,18 @@ static int ocfs2_get_truncate_log_info(struct ocfs2_super *osb,
6171
6174
goto bail ;
6172
6175
}
6173
6176
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
+
6174
6189
* tl_inode = inode ;
6175
6190
* tl_bh = bh ;
6176
6191
bail :
You can’t perform that action at this time.
0 commit comments