Commit 071fb1bc authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'exfat-for-5.8-rc7' of...

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()
parents 8c26c87b db415f7a
...@@ -1112,7 +1112,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei, ...@@ -1112,7 +1112,7 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
ret = exfat_get_next_cluster(sb, &clu.dir); ret = exfat_get_next_cluster(sb, &clu.dir);
} }
if (ret || clu.dir != EXFAT_EOF_CLUSTER) { if (ret || clu.dir == EXFAT_EOF_CLUSTER) {
/* just initialized hint_stat */ /* just initialized hint_stat */
hint_stat->clu = p_dir->dir; hint_stat->clu = p_dir->dir;
hint_stat->eidx = 0; hint_stat->eidx = 0;
......
...@@ -371,7 +371,7 @@ static inline bool exfat_is_last_sector_in_cluster(struct exfat_sb_info *sbi, ...@@ -371,7 +371,7 @@ static inline bool exfat_is_last_sector_in_cluster(struct exfat_sb_info *sbi,
static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi, static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi,
unsigned int clus) unsigned int clus)
{ {
return ((clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) + return ((sector_t)(clus - EXFAT_RESERVED_CLUSTERS) << sbi->sect_per_clus_bits) +
sbi->data_start_sector; sbi->data_start_sector;
} }
......
...@@ -176,7 +176,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size) ...@@ -176,7 +176,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
ep2->dentry.stream.size = 0; ep2->dentry.stream.size = 0;
} else { } else {
ep2->dentry.stream.valid_size = cpu_to_le64(new_size); ep2->dentry.stream.valid_size = cpu_to_le64(new_size);
ep2->dentry.stream.size = ep->dentry.stream.valid_size; ep2->dentry.stream.size = ep2->dentry.stream.valid_size;
} }
if (new_size == 0) { if (new_size == 0) {
......
...@@ -495,7 +495,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb, ...@@ -495,7 +495,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
struct exfat_uni_name *p_uniname, int *p_lossy) struct exfat_uni_name *p_uniname, int *p_lossy)
{ {
int i, unilen, lossy = NLS_NAME_NO_LOSSY; int i, unilen, lossy = NLS_NAME_NO_LOSSY;
unsigned short upname[MAX_NAME_LENGTH + 1]; __le16 upname[MAX_NAME_LENGTH + 1];
unsigned short *uniname = p_uniname->name; unsigned short *uniname = p_uniname->name;
WARN_ON(!len); WARN_ON(!len);
...@@ -519,7 +519,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb, ...@@ -519,7 +519,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
exfat_wstrchr(bad_uni_chars, *uniname)) exfat_wstrchr(bad_uni_chars, *uniname))
lossy |= NLS_NAME_LOSSY; lossy |= NLS_NAME_LOSSY;
upname[i] = exfat_toupper(sb, *uniname); upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname));
uniname++; uniname++;
} }
...@@ -597,7 +597,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb, ...@@ -597,7 +597,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
struct exfat_uni_name *p_uniname, int *p_lossy) struct exfat_uni_name *p_uniname, int *p_lossy)
{ {
int i = 0, unilen = 0, lossy = NLS_NAME_NO_LOSSY; int i = 0, unilen = 0, lossy = NLS_NAME_NO_LOSSY;
unsigned short upname[MAX_NAME_LENGTH + 1]; __le16 upname[MAX_NAME_LENGTH + 1];
unsigned short *uniname = p_uniname->name; unsigned short *uniname = p_uniname->name;
struct nls_table *nls = EXFAT_SB(sb)->nls_io; struct nls_table *nls = EXFAT_SB(sb)->nls_io;
...@@ -611,7 +611,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb, ...@@ -611,7 +611,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
exfat_wstrchr(bad_uni_chars, *uniname)) exfat_wstrchr(bad_uni_chars, *uniname))
lossy |= NLS_NAME_LOSSY; lossy |= NLS_NAME_LOSSY;
upname[unilen] = exfat_toupper(sb, *uniname); upname[unilen] = cpu_to_le16(exfat_toupper(sb, *uniname));
uniname++; uniname++;
unilen++; unilen++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment