OSDN Git Service

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)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 11 Feb 2019 05:02:05 +0000 (00:02 -0500)
commit67a11611e1a5211f6569044fbf8150875764d1d0
tree331c544d8b46a2e6d794d95c52d9a4c787164d7a
parenta297b2fcee461e40df763e179cbbfba5a9e572d2
ext4: fix check of inode in swap_inode_boot_loader

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
fs/ext4/ioctl.c