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

From: Dan Carpenter
Date: Wed Jan 29 2020 - 10:16:03 EST


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