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: <20071205231804.GA3604@webber.adilger.int>
Date:	Wed, 5 Dec 2007 16:18:04 -0700
From:	Andreas Dilger <adilger@....com>
To:	Eric Sandeen <sandeen@...hat.com>
Cc:	ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 1/3] ext4: different maxbytes functions for bitmap &
	extent files

On Dec 04, 2007  09:58 -0600, Eric Sandeen wrote:
> +static loff_t ext4_max_size(int blkbits)
> +{
> +	loff_t res;
> +	loff_t upper_limit = MAX_LFS_FILESIZE;
> +
> +	/* small i_blocks in vfs inode? */
> +	if (sizeof(blkcnt_t) < sizeof(u64)) {

It would probably be more future-proof by having a struct inode here and
using "if (sizeof(inode->i_blocks) < sizeof(__u64))".

> +		upper_limit = (1LL << 32) - 1;
> +
> +		/* total blocks in file system block size */
> +		upper_limit >>= (blkbits - 9);
> +		upper_limit <<= blkbits;

There is probably a cleaner way to do this, maybe:

		upper_limit = (1LL << (32 + 9) - 1) & ~((1 << blkbits) - 1);

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ