ext4: fix check of inode in swap_inode_boot_loader
authoryangerkun <yangerkun@huawei.com>
Mon, 11 Feb 2019 05:02:05 +0000 (00:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:10:01 +0000 (20:10 +0100)
commitcdf9941b770748eb007bbe98df618b0c705b7745
tree28c1ee857dbc6e8f1f2cf75678337ed49e67233e
parentae228aca576d529415da66c7e1209d631f68dee7
ext4: fix check of inode in swap_inode_boot_loader

commit 67a11611e1a5211f6569044fbf8150875764d1d0 upstream.

Before really do swap between inode and boot inode, something need to
check to avoid invalid or not permitted operation, like does this inode
has inline data. But the condition check should be protected by inode
lock to avoid change while swapping. Also some other condition will not
change between swapping, but there has no problem to do this under inode
lock.

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