Skip to content
Commit 92fba084 authored by Christophe Vu-Brugier's avatar Christophe Vu-Brugier Committed by Namjae Jeon
Browse files

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 0c336d6e ("exfat: fix incorrect loading of i_blocks for
                        large files")

Fixes: 98d91704 ("exfat: add file operations")
Cc: stable@vger.kernel.org # v5.7+
Suggested-by: default avatarMatthew Wilcox <willy@infradead.org>
Reviewed-by: default avatarSungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: default avatarChristophe Vu-Brugier <christophe.vu-brugier@seagate.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
parent 7dee6f57
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment