]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: cleanup pagecache before swap i_data
authoryangerkun <yangerkun@huawei.com>
Mon, 11 Feb 2019 05:05:24 +0000 (00:05 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Feb 2019 05:05:24 +0000 (00:05 -0500)
commitc984f25a72c8497f57f6c1b43f594c5a0bbb1147
tree5514fcd695413fddddab5f833827b0e6eec17002
parent6437f0ea8320c249d006e2ef4873f6b4ac3b904b
ext4: cleanup pagecache before swap i_data

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: yangerkun <yangerkun@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/ioctl.c