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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1112,7 +1112,7 @@ found:
			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 */
			hint_stat->clu = p_dir->dir;
			hint_stat->eidx = 0;
+1 −1
Original line number Diff line number Diff line
@@ -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,
		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;
}

+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size)
			ep2->dentry.stream.size = 0;
		} else {
			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) {
+4 −4
Original line number Diff line number Diff line
@@ -495,7 +495,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
		struct exfat_uni_name *p_uniname, int *p_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;

	WARN_ON(!len);
@@ -519,7 +519,7 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
		    exfat_wstrchr(bad_uni_chars, *uniname))
			lossy |= NLS_NAME_LOSSY;

		upname[i] = exfat_toupper(sb, *uniname);
		upname[i] = cpu_to_le16(exfat_toupper(sb, *uniname));
		uniname++;
	}

@@ -597,7 +597,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
		struct exfat_uni_name *p_uniname, int *p_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;
	struct nls_table *nls = EXFAT_SB(sb)->nls_io;

@@ -611,7 +611,7 @@ static int exfat_nls_to_ucs2(struct super_block *sb,
		    exfat_wstrchr(bad_uni_chars, *uniname))
			lossy |= NLS_NAME_LOSSY;

		upname[unilen] = exfat_toupper(sb, *uniname);
		upname[unilen] = cpu_to_le16(exfat_toupper(sb, *uniname));
		uniname++;
		unilen++;
	}