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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 3 Aug 2007 20:40:13 -0400
From:	Theodore Tso <tytso@....edu>
To:	Girish Shilamkar <girish@...sterfs.com>
Cc:	Ext4 Mailing List <linux-ext4@...r.kernel.org>,
	Andreas Dilger <adilger@...sterfs.com>
Subject: Re: [Patch 4/13] Allow regular files to be preallocated on-disk.

On Tue, Jul 24, 2007 at 04:34:48PM +0530, Girish Shilamkar wrote:
> Allow regular files to be preallocated on-disk up to the next multiple
> of the system PAGE_SIZE without complaining about extra blocks.

Applied, with some fixups.

>  	} else {
> +		e2_blkcnt_t blkpg = getpagesize() / fs->blocksize;

The getpagesize() call was marked LEGACY in SuSv2, and it was dropped
in POSIX.1-2001.  It's much better to use sysconf(_SC_PAGESIZE).

Also, the patch will cause e2fsck to core dump if it is asked to check
a filesystem where fs->blocksize is > page_size.  So in that case, we
have to set blkpg to 1.

Finally, it's a bad idea to call getpagesize() for every single inode,
since potentially getpagesize() or sysconf(_SC_PAGESIZE) could
potentially require a system call.  So this should be factored out and
stashed away in the e2fsck context structure.

I'm also a little concerned this patch doesn't solve the problem where
a filesystem that had been previously mounted on an IA64 machine gets
connected to an x86 machine and then e2fsck is run.  This patch
doesn't make the problem any more worse, and to fix this for real
would require stashing the largest blocksize ever used by the
filesystem in the superblock, and I'm not entirely convinced it's
worth it.

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