lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 020/917] exfat: fix incorrect loading of i_blocks for large files
    Date
    From: Sungjong Seo <sj1557.seo@samsung.com>

    commit 0c336d6e33f4bedc443404c89f43c91c8bd9ee11 upstream.

    When calculating i_blocks, there was a mistake that was masked with a
    32-bit variable. So i_blocks for files larger than 4 GiB had incorrect
    values. Mask with a 64-bit variable instead of 32-bit one.

    Fixes: 5f2aa075070c ("exfat: add inode operations")
    Cc: stable@vger.kernel.org # v5.7+
    Reported-by: Ganapathi Kamath <hgkamath@hotmail.com>
    Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
    Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    fs/exfat/inode.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/exfat/inode.c
    +++ b/fs/exfat/inode.c
    @@ -604,7 +604,7 @@ static int exfat_fill_inode(struct inode
    exfat_save_attr(inode, info->attr);

    inode->i_blocks = ((i_size_read(inode) + (sbi->cluster_size - 1)) &
    - ~(sbi->cluster_size - 1)) >> inode->i_blkbits;
    + ~((loff_t)sbi->cluster_size - 1)) >> inode->i_blkbits;
    inode->i_mtime = info->mtime;
    inode->i_ctime = info->mtime;
    ei->i_crtime = info->crtime;

    \
     
     \ /
      Last update: 2021-11-16 02:40    [W:2.133 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site