Re: [Patch 4/13] Allow regular files to be preallocated on-disk.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux