f2fs: fix to dirty inode for i_mode recovery
authorChao Yu <yuchao0@huawei.com>
Sat, 23 Feb 2019 01:48:27 +0000 (09:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:16:05 +0000 (09:16 +0200)
commit48b0309f85ae819da5bbe992b8769729f39c66c7
treef2159f0d71dcea47f7c678f70c939206ff48268d
parent11582064271db6931a982fdf36c0522b7e24744a
f2fs: fix to dirty inode for i_mode recovery

[ Upstream commit ca597bddedd94906cd761d8be6a3ad21292725de ]

As Seulbae Kim reported in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=202637

We didn't recover permission field correctly after sudden power-cut,
the reason is in setattr we didn't add inode into global dirty list
once i_mode is changed, so latter checkpoint triggered by fsync will
not flush last i_mode into disk, result in this problem, fix it.

Reported-by: Seulbae Kim <seulbae@gatech.edu>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/file.c