diff options
-rw-r--r-- | fs/ext3/balloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index 5b8344fab79d..db1906b4e39c 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
@@ -1991,6 +1991,7 @@ ext3_grpblk_t ext3_trim_all_free(struct super_block *sb, unsigned int group, | |||
1991 | spin_unlock(sb_bgl_lock(sbi, group)); | 1991 | spin_unlock(sb_bgl_lock(sbi, group)); |
1992 | percpu_counter_sub(&sbi->s_freeblocks_counter, next - start); | 1992 | percpu_counter_sub(&sbi->s_freeblocks_counter, next - start); |
1993 | 1993 | ||
1994 | free_blocks -= next - start; | ||
1994 | /* Do not issue a TRIM on extents smaller than minblocks */ | 1995 | /* Do not issue a TRIM on extents smaller than minblocks */ |
1995 | if ((next - start) < minblocks) | 1996 | if ((next - start) < minblocks) |
1996 | goto free_extent; | 1997 | goto free_extent; |
@@ -2040,7 +2041,7 @@ free_extent: | |||
2040 | cond_resched(); | 2041 | cond_resched(); |
2041 | 2042 | ||
2042 | /* No more suitable extents */ | 2043 | /* No more suitable extents */ |
2043 | if ((free_blocks - count) < minblocks) | 2044 | if (free_blocks < minblocks) |
2044 | break; | 2045 | break; |
2045 | } | 2046 | } |
2046 | 2047 | ||