lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87k35m3ufa.fsf@devron.myhome.or.jp>
Date:	Wed, 03 Sep 2014 00:37:29 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Seunghun Lee <waydi1@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] fat: Simplify calc_fat_clusters code

Seunghun Lee <waydi1@...il.com> writes:

> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 756aead..6992dea 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1307,12 +1307,9 @@ static unsigned long calc_fat_clusters(struct super_block *sb)
>  	struct msdos_sb_info *sbi = MSDOS_SB(sb);
>  
>  	/* Divide first to avoid overflow */
> -	if (sbi->fat_bits != 12) {
> -		unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
> -		return ent_per_sec * sbi->fat_length;
> -	}
> +	unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
>  
> -	return sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits;
> +	return ent_per_sec * sbi->fat_length;
>  }

When sbi->fat_bits == 12, it doesn't work, right? (there is the remainder)

Thanks.
-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ