Re: [PATCH] ext4: avoid utf8_strncasecmp() with unstable name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 29, 2020 at 11:02:16PM -0700, Eric Biggers wrote:
> +	if (len <= DNAME_INLINE_LEN - 1) {
> +		unsigned int i;
> +
> +		for (i = 0; i < len; i++)
> +			strbuf[i] = READ_ONCE(str[i]);
> +		strbuf[len] = 0;

This READ_ONCE is going to force the compiler to use byte accesses.
What's wrong with using a plain memcpy()?

> +		qstr.name = strbuf;
> +	}
> +
>  	return ext4_ci_compare(inode, name, &qstr, false);
>  }
>  
> -- 
> 2.26.2
> 



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux