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] [day] [month] [year] [list]
Date:	Thu, 11 Oct 2007 00:17:44 +0200
From:	Jan Kara <jack@....cz>
To:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc:	linux-ext4@...r.kernel.org
Subject: Re: max file size for ext3

  Hello,

> I am looking at ext4_max_size and was confused how the
> number upper_limit = 0x1ff7fffd000LL is arrived. 
> The comment says the value is arrived looking at 4K.
> So i tried the below program. 
> 
> main()
> {
> 	unsigned long long upper_limit, meta_blocks;
> 	int bits = 12;
> 
> 	/* total blocks in 512 bytes */
> 	upper_limit = (1LL << 32) - 1;
> 	/* total blocks in file system block size */
> 	upper_limit >>= (bits - 9);
> 
> 
> 	meta_blocks = 1;
> 	/* double indirect blocks */
> 	meta_blocks += 1 + 1LL << (bits-2);
> 	/* tripple indirect blocks */
> 	meta_blocks += 1 + 1LL << (bits-2) + 1LL << (2*(bits-2));
> 
> 	upper_limit -= meta_blocks;
> 	upper_limit <<= bits;
> 
> 	printf("%x\n", upper_limit);
> }
> 
> Can somebody help me to find out what is missing in the above ?
  You actually overestimate the number of triply indirect blocks in your
program above (you count all possible but since the limit is around 2TB
only roughly half of them is really needed).

> I also think hardcoding 4k block size is not correct. I have the below
> patch pending with large file size.
  It is incorrect for blocksize larger than 4096, that's right. Your
patch looks fine - we loose a bit of filesize limit but I don't think it
really matters.

								Honza
-
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