ext4: fix warning when turn on dioread_nolock and inline_data
authoryangerkun <yangerkun@huawei.com>
Sun, 11 Aug 2019 20:27:41 +0000 (16:27 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 11 Aug 2019 20:27:41 +0000 (16:27 -0400)
commit4e34323135ec0752af152ac588a4f96495074849
treec114f464dd3cfe40db1715d04398f310d42b01ca
parentd45331b00ddb179e291766617259261c112db872
ext4: fix warning when turn on dioread_nolock and inline_data

mkfs.ext4 -O inline_data /dev/vdb
mount -o dioread_nolock /dev/vdb /mnt
echo "some inline data..." >> /mnt/test-file
echo "some inline data..." >> /mnt/test-file
sync

The above script will trigger "WARN_ON(!io_end->handle && sbi->s_journal)"
because ext4_should_dioread_nolock() returns false for a file with inline
data. Move the check to a place after we have already removed the inline
data and prepared inode to write normal pages.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: yangerkun <yangerkun@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c