linux/fs/exfat
Christophe Vu-Brugier 92fba084b7 exfat: fix i_blocks for files truncated over 4 GiB
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>
2022-01-10 11:00:02 +09: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: make exfat_find_location() static 2022-01-10 11:00:01 +09:00
exfat_fs.h exfat: make exfat_find_location() static 2022-01-10 11:00:01 +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: simplify is_valid_cluster() 2022-01-10 11:00:00 +09:00
file.c exfat: fix i_blocks for files truncated over 4 GiB 2022-01-10 11:00:02 +09:00
inode.c exfat: fix i_blocks for files truncated over 4 GiB 2022-01-10 11:00:02 +09: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-01-10 11:00:02 +09: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-01-10 11:00:02 +09:00