Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 196ba8a8 authored by zhengliang's avatar zhengliang Committed by Jaegeuk Kim
Browse files

f2fs: fix to data block override node segment by mistake



The following race could lead to data block override node segment by mistake.

Task A            |    Task B         |  Task C            |    Task D
=======           |   ========        |==========          |  =========
open file         |                   |                    |
white file        |                   |                    |
submit bio        |                   |                    |
wait io complete  |                   |                    |
		  |   remove file     |                    |
........          |   iput_final      |                    |
		  |                   |   sync             |
		  |                   |  do checkpoint     |
		  |		      |  data segment free |
		  |                   |                    | create file1
		  |		      |		           | allocate node segment(if it is the same segment freed by Task C)
f2fs_write_end_io |		      |                    |

So we need to guarantee io complete before truncate inode
in f2fs_drop_inode.

Signed-off-by: default avatarZheng Liang <zhengliang6@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 073cb400
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment