f2fs: fix to avoid race when accessing last_disk_size
authorChao Yu <yuchao0@huawei.com>
Mon, 9 Oct 2017 09:55:19 +0000 (17:55 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 19 Dec 2017 01:21:58 +0000 (17:21 -0800)
commit8c5827634ad6b8dfe1f79cf8cc29aa3ddc6e37f7
treea0e16ac6565eb425d7f15c87f240eb4be4a603af
parentc2e2eec698e2cdf4da14336f3e736adb2784d92d
f2fs: fix to avoid race when accessing last_disk_size

last_disk_size could be wrong due to concurrently updating, so using
i_sem semaphore to make last_disk_size updating exclusive to fix this
issue.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/file.c