diff options
author | Yuezhang Mo <Yuezhang.Mo@sony.com> | 2023-01-04 09:37:47 +0300 |
---|---|---|
committer | Namjae Jeon <linkinjeon@kernel.org> | 2023-02-27 15:14:45 +0300 |
commit | 39c1ce8eafc0ff64fb9e28536ccc7df6a8e2999d (patch) | |
tree | badb112dfa32ee543e7c91671d656065b26f4ea7 /fs/exfat/namei.c | |
parent | bdaadfd343e3cba49ad0b009ff4b148dad0fa404 (diff) | |
download | linux-39c1ce8eafc0ff64fb9e28536ccc7df6a8e2999d.tar.xz |
exfat: fix inode->i_blocks for non-512 byte sector size device
inode->i_blocks is not real number of blocks, but 512 byte ones.
Fixes: 98d917047e8b ("exfat: add file operations")
Cc: stable@vger.kernel.org # v5.7+
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
Tested-by: Wang Yugui <wangyugui@e16-tech.com>
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/exfat/namei.c')
-rw-r--r-- | fs/exfat/namei.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 5f995eba5dbb..7442fead0279 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -396,7 +396,7 @@ static int exfat_find_empty_entry(struct inode *inode, ei->i_size_ondisk += sbi->cluster_size; ei->i_size_aligned += sbi->cluster_size; ei->flags = p_dir->flags; - inode->i_blocks += 1 << sbi->sect_per_clus_bits; + inode->i_blocks += sbi->cluster_size >> 9; } return dentry; |