]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix bs < ps issue reported with dioread_nolock mount opt
authorRitesh Harjani <riteshh@linux.ibm.com>
Thu, 8 Oct 2020 15:02:48 +0000 (20:32 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 18 Oct 2020 14:37:15 +0000 (10:37 -0400)
commit40ed38a92876550bc50a32607ac7885409e40d6a
tree87cd994bf8656232343d3e047c1c348a2f3628ae
parent4877ec36b52a2d8d8c2df6039437fb8e398ea729
ext4: fix bs < ps issue reported with dioread_nolock mount opt

left shifting m_lblk by blkbits was causing value overflow and hence
it was not able to convert unwritten to written extent.
So, make sure we typecast it to loff_t before do left shift operation.
Also in func ext4_convert_unwritten_io_end_vec(), make sure to initialize
ret variable to avoid accidentally returning an uninitialized ret.

This patch fixes the issue reported in ext4 for bs < ps with
dioread_nolock mount option.

Fixes: 1b0af506d7cdffc9fa16 ("ext4: Add support for blocksize < pagesize in dioread_nolock")
Cc: stable@kernel.org
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/af902b5db99e8b73980c795d84ad7bb417487e76.1602168865.git.riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents.c
fs/ext4/inode.c