diff options
| author | Chao Yu <yuchao0@huawei.com> | 2017-08-23 18:23:24 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-10-04 15:35:23 +0200 |
| commit | 07bfd2d45a09fc89965d97685a6c071e88ce854f (patch) | |
| tree | 2efc83adb06b9a410a1b67f0fa94d4655bc38b73 /fs/f2fs | |
| parent | 8e38e49204461c2781ad17fd3885fbcfc4c7b6a2 (diff) | |
f2fs: fix to avoid race in between aio and gc
We won't wait DIO synchronously when doing AIO, so there will be potential
IO reorder in between AIO and GC, which will cause data corruption.
This patch adds inode_dio_wait to serialize aio and data GC to avoid this
issue.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
| -rw-r--r-- | fs/f2fs/gc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index ca038467d..a375d38de 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -875,6 +875,9 @@ next_step: continue; } locked = true; + + /* wait for all inflight aio data */ + inode_dio_wait(inode); } start_bidx = start_bidx_of_node(nofs, inode) |
