[PATCH] staging: exfat: remove 'vol_type' variable.

Dan Carpenter dan.carpenter at oracle.com
Wed Jan 29 15:15:41 UTC 2020


On Wed, Jan 29, 2020 at 08:12:32PM +0900, Tetsuhiro Kohada wrote:
> @@ -2085,7 +2069,7 @@ static int exfat_readdir(struct file *filp, struct dir_context *ctx)
>  
>  	cpos = ctx->pos;
>  	/* Fake . and .. for the root directory. */
> -	if ((p_fs->vol_type == EXFAT) || (inode->i_ino == EXFAT_ROOT_INO)) {
> +	if (inode->i_ino == EXFAT_ROOT_INO) {

This isn't right.  The first condition is always true so in the original
code we never bothered to check the second condition.

>  		while (cpos < 2) {
>  			if (inode->i_ino == EXFAT_ROOT_INO)
>  				inum = EXFAT_ROOT_INO;

regards,
dan carpenter



More information about the devel mailing list