diff options
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index fe075aa12893..7ddf0d3cbece 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -1226,10 +1226,13 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
1226 | buf->f_blocks = total_count - start_count; | 1226 | buf->f_blocks = total_count - start_count; |
1227 | buf->f_bfree = user_block_count - valid_user_blocks(sbi) - | 1227 | buf->f_bfree = user_block_count - valid_user_blocks(sbi) - |
1228 | sbi->current_reserved_blocks; | 1228 | sbi->current_reserved_blocks; |
1229 | |||
1230 | spin_lock(&sbi->stat_lock); | ||
1229 | if (unlikely(buf->f_bfree <= sbi->unusable_block_count)) | 1231 | if (unlikely(buf->f_bfree <= sbi->unusable_block_count)) |
1230 | buf->f_bfree = 0; | 1232 | buf->f_bfree = 0; |
1231 | else | 1233 | else |
1232 | buf->f_bfree -= sbi->unusable_block_count; | 1234 | buf->f_bfree -= sbi->unusable_block_count; |
1235 | spin_unlock(&sbi->stat_lock); | ||
1233 | 1236 | ||
1234 | if (buf->f_bfree > F2FS_OPTION(sbi).root_reserved_blocks) | 1237 | if (buf->f_bfree > F2FS_OPTION(sbi).root_reserved_blocks) |
1235 | buf->f_bavail = buf->f_bfree - | 1238 | buf->f_bavail = buf->f_bfree - |
@@ -1508,7 +1511,10 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi) | |||
1508 | if (err) | 1511 | if (err) |
1509 | goto out_unlock; | 1512 | goto out_unlock; |
1510 | 1513 | ||
1514 | spin_lock(&sbi->stat_lock); | ||
1511 | sbi->unusable_block_count = 0; | 1515 | sbi->unusable_block_count = 0; |
1516 | spin_unlock(&sbi->stat_lock); | ||
1517 | |||
1512 | out_unlock: | 1518 | out_unlock: |
1513 | mutex_unlock(&sbi->gc_mutex); | 1519 | mutex_unlock(&sbi->gc_mutex); |
1514 | restore_flag: | 1520 | restore_flag: |