From: Theodore Tso <tytso@mit.edu>
To: Girish Shilamkar <girish@clusterfs.com>
Cc: Ext4 Mailing List <linux-ext4@vger.kernel.org>,
Andreas Dilger <adilger@clusterfs.com>
Subject: Re: [Patch 4/13] Allow regular files to be preallocated on-disk.
Date: Fri, 3 Aug 2007 20:40:13 -0400 [thread overview]
Message-ID: <20070804004013.GF7449@thunk.org> (raw)
In-Reply-To: <1185275088.3789.69.camel@dhcp4.linsyssoft.com>
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
next prev parent reply other threads:[~2007-08-04 6:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 11:04 [Patch 4/13] Allow regular files to be preallocated on-disk Girish Shilamkar
2007-08-04 0:40 ` Theodore Tso [this message]
2007-08-04 16:19 ` Andreas Dilger
2007-08-04 18:38 ` Theodore Tso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070804004013.GF7449@thunk.org \
--to=tytso@mit.edu \
--cc=adilger@clusterfs.com \
--cc=girish@clusterfs.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).