@@ -1114,10 +1114,9 @@ int bch2_check_inodes(struct bch_fs *c)
1114
1114
return ret ;
1115
1115
}
1116
1116
1117
- static int check_i_sectors (struct btree_trans * trans , struct inode_walker * w )
1117
+ static int check_i_sectors_notnested (struct btree_trans * trans , struct inode_walker * w )
1118
1118
{
1119
1119
struct bch_fs * c = trans -> c ;
1120
- u32 restart_count = trans -> restart_count ;
1121
1120
int ret = 0 ;
1122
1121
s64 count2 ;
1123
1122
@@ -1149,7 +1148,14 @@ static int check_i_sectors(struct btree_trans *trans, struct inode_walker *w)
1149
1148
}
1150
1149
fsck_err :
1151
1150
bch_err_fn (c , ret );
1152
- return ret ?: trans_was_restarted (trans , restart_count );
1151
+ return ret ;
1152
+ }
1153
+
1154
+ static int check_i_sectors (struct btree_trans * trans , struct inode_walker * w )
1155
+ {
1156
+ u32 restart_count = trans -> restart_count ;
1157
+ return check_i_sectors_notnested (trans , w ) ?:
1158
+ trans_was_restarted (trans , restart_count );
1153
1159
}
1154
1160
1155
1161
struct extent_end {
@@ -1533,7 +1539,7 @@ int bch2_check_extents(struct bch_fs *c)
1533
1539
check_extent (trans , & iter , k , & w , & s , & extent_ends ) ?:
1534
1540
check_extent_overbig (trans , & iter , k );
1535
1541
})) ?:
1536
- check_i_sectors (trans , & w ));
1542
+ check_i_sectors_notnested (trans , & w ));
1537
1543
1538
1544
bch2_disk_reservation_put (c , & res );
1539
1545
extent_ends_exit (& extent_ends );
@@ -1563,10 +1569,9 @@ int bch2_check_indirect_extents(struct bch_fs *c)
1563
1569
return ret ;
1564
1570
}
1565
1571
1566
- static int check_subdir_count (struct btree_trans * trans , struct inode_walker * w )
1572
+ static int check_subdir_count_notnested (struct btree_trans * trans , struct inode_walker * w )
1567
1573
{
1568
1574
struct bch_fs * c = trans -> c ;
1569
- u32 restart_count = trans -> restart_count ;
1570
1575
int ret = 0 ;
1571
1576
s64 count2 ;
1572
1577
@@ -1598,7 +1603,14 @@ static int check_subdir_count(struct btree_trans *trans, struct inode_walker *w)
1598
1603
}
1599
1604
fsck_err :
1600
1605
bch_err_fn (c , ret );
1601
- return ret ?: trans_was_restarted (trans , restart_count );
1606
+ return ret ;
1607
+ }
1608
+
1609
+ static int check_subdir_count (struct btree_trans * trans , struct inode_walker * w )
1610
+ {
1611
+ u32 restart_count = trans -> restart_count ;
1612
+ return check_subdir_count_notnested (trans , w ) ?:
1613
+ trans_was_restarted (trans , restart_count );
1602
1614
}
1603
1615
1604
1616
static int check_dirent_inode_dirent (struct btree_trans * trans ,
@@ -2003,7 +2015,8 @@ int bch2_check_dirents(struct bch_fs *c)
2003
2015
k ,
2004
2016
NULL , NULL ,
2005
2017
BCH_TRANS_COMMIT_no_enospc ,
2006
- check_dirent (trans , & iter , k , & hash_info , & dir , & target , & s )));
2018
+ check_dirent (trans , & iter , k , & hash_info , & dir , & target , & s )) ?:
2019
+ check_subdir_count_notnested (trans , & dir ));
2007
2020
2008
2021
snapshots_seen_exit (& s );
2009
2022
inode_walker_exit (& dir );
0 commit comments