ext4: add mask of ext4 flags to swap
authoryangerkun <yangerkun@huawei.com>
Mon, 11 Feb 2019 05:35:06 +0000 (00:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:10:02 +0000 (20:10 +0100)
commita0d876c77705c1dd2df2d89e040bf570755cd676
treed650133ed166ba1e5d49d2c82f526dac59ea87b1
parent048bfb5bc05f7be392f025cdcd655878e88a4eaf
ext4: add mask of ext4 flags to swap

commit abdc644e8cbac2e9b19763680e5a7cf9bab2bee7 upstream.

The reason is that while swapping two inode, we swap the flags too.
Some flags such as EXT4_JOURNAL_DATA_FL can really confuse the things
since we're not resetting the address operations structure.  The
simplest way to keep things sane is to restrict the flags that can be
swapped.

Signed-off-by: yangerkun <yangerkun@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/ext4.h
fs/ext4/ioctl.c