[PATCH 2/3] f2fs: avoid data race when deciding checkpoin in f2fs_sync_file

2016-07-20 Thread Jaegeuk Kim
When fs utilization is almost full, f2fs_sync_file should do checkpoint if there is not enough space for roll-forward later. (i.e. space_for_roll_forward) So, currently we have no lock for sbi->alloc_valid_block_count, resulting in race condition. In rare case, we can get -ENOSPC when doing

[PATCH 2/3] f2fs: avoid data race when deciding checkpoin in f2fs_sync_file

2016-07-20 Thread Jaegeuk Kim
When fs utilization is almost full, f2fs_sync_file should do checkpoint if there is not enough space for roll-forward later. (i.e. space_for_roll_forward) So, currently we have no lock for sbi->alloc_valid_block_count, resulting in race condition. In rare case, we can get -ENOSPC when doing