From: Andreas Dilger <adilger@sun.com>
To: "Theodore Ts'o" <tytso@mit.edu>
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 07:57:06 +0800 [thread overview]
Message-ID: <20090116235706.GK13929@webber.adilger.int> (raw)
In-Reply-To: <1232125148-13785-1-git-send-email-tytso@mit.edu>
On Jan 16, 2009 11:59 -0500, Theodore Ts'o wrote:
> Directories are not allowed to be bigger than 2TB, so don't use
... bigger than 2GB?
> i_size_high when reading the inode. E2fsck should complain about
> these inodes, but the simplest thing to do for the kernel is simply to
> not consult i_size_high for directory inodes.
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.
> 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.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
next prev parent reply other threads:[~2009-01-16 23:57 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 [this message]
2009-01-17 23:36 ` 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=20090116235706.GK13929@webber.adilger.int \
--to=adilger@sun.com \
--cc=linux-ext4@vger.kernel.org \
--cc=stable@kernel.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.