}
return 0;
@@ -3961,16 +3972,8 @@ ext4_mb_release_inode_pa(struct ext4_bud
- /* "free < pa->pa_free" means we maybe double alloc the same blocks,
* otherwise maybe leave some free blocks unavailable, no need to BUG.*/
- if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {
+ if (((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) &&
+ atomic_read(&sb->s_active) > 0) {
- ext4_error(sb, "pa free mismatch: [pa %p] "
- "[phy %lu] [logic %lu] [len %u] [free %u] "
- "[error %u] [inode %lu] [freed %u]", pa,
ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit);
grp_blk_start = pa->pa_pstart - EXT4_C2B(sbi, bit);
BUG_ON(group != e4b->bd_group && pa->pa_len != 0);
-@@ -3891,12 +3895,18 @@ ext4_mb_release_inode_pa(struct ext4_bud
+@@ -3891,12 +3895,19 @@ ext4_mb_release_inode_pa(struct ext4_bud
mb_free_blocks(pa->pa_inode, e4b, bit, next - bit);
bit = next + 1;
}
+
+ /* "free < pa->pa_free" means we maybe double alloc the same blocks,
+ * otherwise maybe leave some free blocks unavailable, no need to BUG.*/
-+ if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {
++ if (((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) &&
++ atomic_read(&sb->s_active) > 0) {
+ ext4_error(sb, "pa free mismatch: [pa %p] "
+ "[phy %lu] [logic %lu] [len %u] [free %u] "
+ "[error %u] [inode %lu] [freed %u]", pa,
*/
}
+ /* do not verify if the file system is being umounted */
-+ BUG_ON(atomic_read(&sb->s_active) > 0 && pa->pa_free != free);
++ BUG_ON(pa->pa_free != free && atomic_read(&sb->s_active) > 0);
atomic_add(free, &sbi->s_mb_discarded);
return err;
}
return 0;
@@ -4037,16 +4044,8 @@ ext4_mb_release_inode_pa(struct ext4_bud
- /* "free < pa->pa_free" means we maybe double alloc the same blocks,
* otherwise maybe leave some free blocks unavailable, no need to BUG.*/
- if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {
+ if (((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) &&
+ atomic_read(&sb->s_active) > 0) {
- ext4_error(sb, "pa free mismatch: [pa %p] "
- "[phy %lu] [logic %lu] [len %u] [free %u] "
- "[error %u] [inode %lu] [freed %u]", pa,
}
return 0;
@@ -4016,16 +4023,8 @@ ext4_mb_release_inode_pa(struct ext4_bud
- /* "free < pa->pa_free" means we maybe double alloc the same blocks,
* otherwise maybe leave some free blocks unavailable, no need to BUG.*/
- if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {
+ if (((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) &&
+ atomic_read(&sb->s_active) > 0) {
- ext4_error(sb, "pa free mismatch: [pa %p] "
- "[phy %lu] [logic %lu] [len %u] [free %u] "
- "[error %u] [inode %lu] [freed %u]", pa,
}
return 0;
@@ -4052,16 +4063,8 @@ ext4_mb_release_inode_pa(struct ext4_bud
- /* "free < pa->pa_free" means we maybe double alloc the same blocks,
* otherwise maybe leave some free blocks unavailable, no need to BUG.*/
- if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {
+ if (((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) &&
+ atomic_read(&sb->s_active) > 0) {
- ext4_error(sb, "pa free mismatch: [pa %p] "
- "[phy %lu] [logic %lu] [len %u] [free %u] "
- "[error %u] [inode %lu] [freed %u]", pa,
}
return 0;
@@ -4052,16 +4063,8 @@ ext4_mb_release_inode_pa(struct ext4_bud
- /* "free < pa->pa_free" means we maybe double alloc the same blocks,
* otherwise maybe leave some free blocks unavailable, no need to BUG.*/
- if ((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) {
+ if (((free > pa->pa_free && !pa->pa_error) || (free < pa->pa_free)) &&
+ atomic_read(&sb->s_active) > 0) {
- ext4_error(sb, "pa free mismatch: [pa %p] "
- "[phy %lu] [logic %lu] [len %u] [free %u] "
- "[error %u] [inode %lu] [freed %u]", pa,