Commit 14048703 authored by yangerkun's avatar yangerkun Committed by Xie XiuQi
Browse files

ext4: cleanup pagecache before swap i_data



mainline inclusion
from mainline-next
commit a46c68a3
category: bugfix
bugzilla: 5355
CVE: NA
--------------------------------------------------

While do swap, we should make sure there has no new dirty page since we
should swap i_data between two inode:
1.We should lock i_mmap_sem with write to avoid new pagecache from mmap
read/write;
2.Change filemap_flush to filemap_write_and_wait and move them to the
space protected by inode lock to avoid new pagecache from buffer read/write.

Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Reviewed-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent b8d0a408
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment