File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ xfs_dir3_leaf_check_int(
146
146
xfs_dir2_leaf_tail_t * ltp ;
147
147
int stale ;
148
148
int i ;
149
+ bool isleaf1 = (hdr -> magic == XFS_DIR2_LEAF1_MAGIC ||
150
+ hdr -> magic == XFS_DIR3_LEAF1_MAGIC );
149
151
150
152
ltp = xfs_dir2_leaf_tail_p (geo , leaf );
151
153
@@ -158,8 +160,7 @@ xfs_dir3_leaf_check_int(
158
160
return __this_address ;
159
161
160
162
/* Leaves and bests don't overlap in leaf format. */
161
- if ((hdr -> magic == XFS_DIR2_LEAF1_MAGIC ||
162
- hdr -> magic == XFS_DIR3_LEAF1_MAGIC ) &&
163
+ if (isleaf1 &&
163
164
(char * )& hdr -> ents [hdr -> count ] > (char * )xfs_dir2_leaf_bests_p (ltp ))
164
165
return __this_address ;
165
166
@@ -175,6 +176,10 @@ xfs_dir3_leaf_check_int(
175
176
}
176
177
if (hdr -> ents [i ].address == cpu_to_be32 (XFS_DIR2_NULL_DATAPTR ))
177
178
stale ++ ;
179
+ if (isleaf1 && xfs_dir2_dataptr_to_db (geo ,
180
+ be32_to_cpu (hdr -> ents [i ].address )) >=
181
+ be32_to_cpu (ltp -> bestcount ))
182
+ return __this_address ;
178
183
}
179
184
if (hdr -> stale != stale )
180
185
return __this_address ;
You can’t perform that action at this time.
0 commit comments