linux/fs/exfat
Christophe Vu-Brugier c9f727219f exfat: fix i_blocks for files truncated over 4 GiB
[ Upstream commit 92fba084b7 ]

In exfat_truncate(), the computation of inode->i_blocks is wrong if
the file is larger than 4 GiB because a 32-bit variable is used as a
mask. This is fixed and simplified by using round_up().

Also fix the same buggy computation in exfat_read_root() and another
(correct) one in exfat_fill_inode(). The latter was fixed another way
last month but can be simplified by using round_up() as well. See:

  commit 0c336d6e33 ("exfat: fix incorrect loading of i_blocks for
                        large files")

Fixes: 98d917047e ("exfat: add file operations")
Cc: stable@vger.kernel.org # v5.7+
Suggested-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-08 19:12:32 +01:00
..
balloc.c exfat: improve write performance when dirsync enabled 2021-04-27 20:45:06 +09:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-07 14:27:13 +09:00
dir.c exfat: handle wrong stream entry size in exfat_readdir() 2021-07-04 09:33:00 +09:00
exfat_fs.h exfat: speed up iterate/lookup by fixing start point of traversing cluster chain 2021-04-27 20:45:07 +09:00
exfat_raw.h exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-22 09:55:13 +09:00
fatent.c exfat: improve write performance when dirsync enabled 2021-04-27 20:45:06 +09:00
file.c exfat: fix i_blocks for files truncated over 4 GiB 2022-03-08 19:12:32 +01:00
inode.c exfat: fix i_blocks for files truncated over 4 GiB 2022-03-08 19:12:32 +01:00
Kconfig exfat: Improve wording of EXFAT_DEFAULT_IOCHARSET config option 2020-06-09 16:48:39 +09:00
Makefile exfat: add Kconfig and Makefile 2020-03-05 21:00:40 -05:00
misc.c exfat: write multiple sectors at once 2020-08-12 08:31:11 +09:00
namei.c exfat: reuse exfat_inode_info variable instead of calling EXFAT_I() 2022-03-08 19:12:31 +01:00
nls.c exfat: Avoid allocating upcase table using kcalloc() 2020-12-22 12:31:17 +09:00
super.c exfat: fix i_blocks for files truncated over 4 GiB 2022-03-08 19:12:32 +01:00