diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-03-01 08:42:27 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-03-01 08:42:27 -0800 |
commit | e103ecedceb37b565962a199c75dd4df57742d50 (patch) | |
tree | a509773c05c289db6a7bda0dfa9ce87e33338507 /fs/exfat/inode.c | |
parent | c0927a7a5391f7d8e593e5e50ead7505a23cadf9 (diff) | |
parent | d5c514b6a0c0b77ed7e5ef2484e8b20eb09c5f27 (diff) | |
download | linux-e103ecedceb37b565962a199c75dd4df57742d50.tar.gz |
Merge tag 'exfat-for-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat
Pull exfat updates from Namjae Jeon:
- Handle vendor extension and allocation entries as unrecognized benign
secondary entries
- Fix wrong ->i_blocks on devices with non-512 byte sector
- Add the check to avoid returning -EIO from exfat_readdir() at current
position exceeding the directory size
- Fix a bug that reach the end of the directory stream at a position
not aligned with the dentry size
- Redefine DIR_DELETED as 0xFFFFFFF7, the bad cluster number
- Two cleanup fixes and fix cluster leakage in error handling
* tag 'exfat-for-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
exfat: fix the newly allocated clusters are not freed in error handling
exfat: don't print error log in normal case
exfat: remove unneeded code from exfat_alloc_cluster()
exfat: handle unreconized benign secondary entries
exfat: fix inode->i_blocks for non-512 byte sector size device
exfat: redefine DIR_DELETED as the bad cluster number
exfat: fix reporting fs error when reading dir beyond EOF
exfat: fix unexpected EOF while reading dir
Diffstat (limited to 'fs/exfat/inode.c')
-rw-r--r-- | fs/exfat/inode.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 5b644cb057fa..481dd338f2b8 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -220,8 +220,7 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset, num_clusters += num_to_be_allocated; *clu = new_clu.dir; - inode->i_blocks += - num_to_be_allocated << sbi->sect_per_clus_bits; + inode->i_blocks += EXFAT_CLU_TO_B(num_to_be_allocated, sbi) >> 9; /* * Move *clu pointer along FAT chains (hole care) because the @@ -576,8 +575,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info) exfat_save_attr(inode, info->attr); - inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> - inode->i_blkbits; + inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9; inode->i_mtime = info->mtime; inode->i_ctime = info->mtime; ei->i_crtime = info->crtime; |