]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: do not block RWF_NOWAIT dio write on unallocated space
authorJan Kara <jack@suse.cz>
Wed, 8 Jul 2020 15:35:16 +0000 (17:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Aug 2020 09:42:06 +0000 (11:42 +0200)
commitd971e09b1b6cb02322eab1ff9c58409a173f6e48
tree3c27e7d8b4698e1aa543f341e31871915161934f
parenta56523673cc02baca851da759e7c09e406bc6550
ext4: do not block RWF_NOWAIT dio write on unallocated space

commit 0b3171b6d195637f84ddf8b59bae818ea20bc8ac upstream.

Since commit 378f32bab371 ("ext4: introduce direct I/O write using iomap
infrastructure") we don't properly bail out of RWF_NOWAIT direct IO
write if underlying blocks are not allocated. Also
ext4_dio_write_checks() does not honor RWF_NOWAIT when re-acquiring
i_rwsem. Fix both issues.

Fixes: 378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure")
Cc: stable@kernel.org
Reported-by: Filipe Manana <fdmanana@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/20200708153516.9507-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/file.c