Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'exfat-for-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat into master

Pull exfat fixes from Namjae Jeon:

- fix overflow issue at sector calculation

- fix wrong hint_stat initialization

- fix wrong size update of stream entry

- fix endianness of upname in name_hash computation

* tag 'exfat-for-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
exfat: fix name_hash computation on big endian systems
exfat: fix wrong size update of stream entry by typo
exfat: fix wrong hint_stat initialization in exfat_find_dir_entry()
exfat: fix overflow issue in exfat_cluster_to_sector()

+7 -7
+1 -1
fs/exfat/dir.c
··· 1112 1112 ret = exfat_get_next_cluster(sb, &clu.dir); 1113 1113 } 1114 1114 1115 - if (ret || clu.dir != EXFAT_EOF_CLUSTER) { 1115 + if (ret || clu.dir == EXFAT_EOF_CLUSTER) { 1116 1116 /* just initialized hint_stat */ 1117 1117 hint_stat->clu = p_dir->dir; 1118 1118 hint_stat->eidx = 0;
+1 -1
fs/exfat/exfat_fs.h
··· 371 371 static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi, 372 372 unsigned int clus) 373 373 { 374 - return ((clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) + 374 + return ((sector_t)(clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) + 375 375 sbi->data_start_sector; 376 376 } 377 377
+1 -1
fs/exfat/file.c
··· 176 176 ep2->dentry.stream.size = 0; 177 177 } else { 178 178 ep2->dentry.stream.valid_size = cpu_to_le64(new_size); 179 - ep2->dentry.stream.size = ep->dentry.stream.valid_size; 179 + ep2->dentry.stream.size = ep2->dentry.stream.valid_size; 180 180 } 181 181 182 182 if (new_size == 0) {
+4 -4
fs/exfat/nls.c
··· 495 495 struct exfat_uni_name *p_uniname, int *p_lossy) 496 496 { 497 497 int i, unilen, lossy = NLS_NAME_NO_LOSSY; 498 - unsigned short upname[MAX_NAME_LENGTH + 1]; 498 + __le16 upname[MAX_NAME_LENGTH + 1]; 499 499 unsigned short *uniname = p_uniname->name; 500 500 501 501 WARN_ON(!len); ··· 519 519 exfat_wstrchr(bad_uni_chars, *uniname)) 520 520 lossy |= NLS_NAME_LOSSY; 521 521 522 - upname[i] = exfat_toupper(sb, *uniname); 522 + upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname)); 523 523 uniname++; 524 524 } 525 525 ··· 597 597 struct exfat_uni_name *p_uniname, int *p_lossy) 598 598 { 599 599 int i = 0, unilen = 0, lossy = NLS_NAME_NO_LOSSY; 600 - unsigned short upname[MAX_NAME_LENGTH + 1]; 600 + __le16 upname[MAX_NAME_LENGTH + 1]; 601 601 unsigned short *uniname = p_uniname->name; 602 602 struct nls_table *nls = EXFAT_SB(sb)->nls_io; 603 603 ··· 611 611 exfat_wstrchr(bad_uni_chars, *uniname)) 612 612 lossy |= NLS_NAME_LOSSY; 613 613 614 - upname[unilen] = exfat_toupper(sb, *uniname); 614 + upname[unilen] = cpu_to_le16(exfat_toupper(sb, *uniname)); 615 615 uniname++; 616 616 unilen++; 617 617 }