From: Theodore Tso <tytso@MIT.EDU>
To: Andreas Dilger <adilger@sun.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>, stable@kernel.org
Subject: Re: [PATCH, RFC] ext4: ignore i_size_high for directories
Date: Sat, 17 Jan 2009 18:36:53 -0500 [thread overview]
Message-ID: <20090117233653.GC25943@mit.edu> (raw)
In-Reply-To: <20090116235706.GK13929@webber.adilger.int>
On Sat, Jan 17, 2009 at 07:57:06AM +0800, Andreas Dilger wrote:
>
> Actually, it would be preferable to allow directories to grow beyond
> the 2GB limit. 2GB only allows about 30M files. While the htree code
> is currently limited to only 2 levels deep, if you have 8kB+ block
> size it is possible to have directories larger than 2GB with only
> 2 levels of htree.
At some point, maybe, although e2fsprogs doesn't have any support for
directories > 2GB, and I strongly suspect there are other places in
the kernel where we assume directories are < 2GB. So this is
something that I'd prefer we implement with a feature flag,
explicitly, probably after we get a better b-tree implementation into
ext4 (say, like the one you gave me a few months ago, if one of us
actually has time to try to get it integrated into the kernel and into
e2fsprogs).
> > static inline loff_t ext4_isize(struct ext4_inode *raw_inode)
> > {
> > + if (S_ISDIR(le16_to_cpu(raw_inode->i_mode)))
> > + return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
> > + else
> > + return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |
> > + le32_to_cpu(raw_inode->i_size_lo);
>
> If you are going to limit this it should be "if (!S_ISREG(...))"
> instead of "if (S_ISDIR(...))" because none of the special files
> should use i_size_high - e2fsck will clear a special inode if
> it has a non-zero size.
Hmm, yes, that's probably a better check; although for most special
inodes we ignore i_size so having an absurd i_size is harmless.
Looking at things, we should probably add a check to make sure that
i_size for symlinks is sane.
- Ted
prev parent reply other threads:[~2009-01-17 23:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 16:59 [PATCH, RFC] ext4: ignore i_size_high for directories Theodore Ts'o
2009-01-16 23:57 ` Andreas Dilger
2009-01-17 23:36 ` Theodore Tso [this message]
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=20090117233653.GC25943@mit.edu \
--to=tytso@mit.edu \
--cc=adilger@sun.com \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@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).