]> git.karo-electronics.de Git - linux-beck.git/commit
f2fs: fix dropping inmemory pages in a wrong time
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 11 Apr 2016 18:51:51 +0000 (11:51 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 15 Apr 2016 15:49:47 +0000 (08:49 -0700)
commitde5307e46d28aa26ffd6f2048398b6303e134a67
treed3dfb485cb2ea31b917d99c3d08c23f19058d2aa
parentff37355886ac2082cee594aa949c08e2cfb33aa0
f2fs: fix dropping inmemory pages in a wrong time

When one reader closes its file while the other writer is doing atomic writes,
f2fs_release_file drops atomic data resulting in an empty commit.
This patch fixes this wrong commit problem by checking openess of the file.

 Process0                       Process1
  open file
 start atomic write
 write data
 read data
close file
f2fs_release_file()
clear atomic data
 commit atomic write

Reported-by: Miao Xie <miaoxie@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c