diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-19 19:20:11 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:33:55 +0200 |
| commit | b947c30462d8c51931ce8b2efa31e3e8dd3019d6 (patch) | |
| tree | f9402e0417e546630daee6244b5655c7d7fb5f4d /include/linux/timerqueue.h | |
| parent | 4da81775bcbef71f1ca360702a67314f43e06c2f (diff) | |
f2fs: avoid data race when deciding checkpoin in f2fs_sync_file
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 roll-forward which triggers
if (is_valid_blkaddr(sbi, dest, META_POR)) {
if (src == NULL_ADDR) {
err = reserve_new_block(&dn);
f2fs_bug_on(sbi, err);
...
}
...
}
in do_recover_data.
So, this patch avoids that situation in advance.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
