OSDN Git Service

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>
Thu, 26 Oct 2017 08:44:12 +0000 (10:44 +0200)
commita0d00fad353d4a315f54fb345aa1c65b3771389b
tree65f4c30f4ca73234c64a42ff9a88e02ad0eb45fa
parentebf7c522fdc2ec2fa0fc2351ef613841f79586e5
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