From: sho@tnes.nec.co.jp
To: adilger@clusterfs.com
Cc: sct@redhat.com, tytso@mit.edu, linux-kernel@vger.kernel.org,
ext2-devel@lists.sourceforge.net, jitendra@linsyssoft.com,
cmm@us.ibm.com
Subject: Re: [UPDATE][13/24]ext3 enlarge file size
Date: Tue, 30 May 2006 21:25:40 +0900 [thread overview]
Message-ID: <20060530212540sho@rifu.tnes.nec.co.jp> (raw)
Hi Andreas,
On May 26, 2006, Andreas wrote:
> > @@ -1465,7 +1472,7 @@ static int ext3_fill_super (struct super
> >
> > if (blocksize > PAGE_SIZE) {
> > printk(KERN_ERR "EXT3-fs: cannot mount filesystem with "
> > - "blocksize %u larger than PAGE_SIZE %u on %s\n",
> > + "blocksize %u larger than PAGE_SIZE %lu on %s\n",
> > blocksize, PAGE_SIZE, sb->s_id);
>
> Why is it that PAGE_SIZE is suddenly changing from unsigned
> to unsigned long?
Oops, you are right.
> On May 25, 2006 21:50 +0900, sho@tnes.nec.co.jp wrote:
> > @@ -2630,8 +2630,13 @@ void ext3_read_inode(struct inode * inod
> > + if (ei->i_flags & EXT3_HUGE_FILE_FL) {
> > + inode->i_blocks =
> (blkcnt_t)le32_to_cpu(raw_inode->i_blocks)
> > + << (inode->i_blkbits - EXT3_SECTOR_BITS);
>
> Please put operators at the end of the line.
Sure.
> > @@ -2763,9 +2769,30 @@ static int ext3_do_update_inode(handle_t
> > + } else {
> > + err = ext3_journal_get_write_access(handle,
> > + EXT3_SB(sb)->s_sbh);
> > + if (err)
> > + goto out_brelse;
> > + ext3_update_dynamic_rev(sb);
> > + EXT3_SET_RO_COMPAT_FEATURE(sb,
> > + EXT3_FEATURE_RO_COMPAT_HUGE_FILE);
> > + sb->s_dirt = 1;
> > + handle->h_sync = 1;
> > + err = ext3_journal_dirty_metadata(handle,
> > + EXT3_SB(sb)->s_sbh);
> > + printk("ext3_do_update_inode: Now the file size is "
> > + "more than 2TB on device (%s)!!\n", sb->s_id);
>
> This part should all be conditional upon RO_COMPAT_HUGE_FILE
> not already
> being set in the superblock. It might make sense to put this into a
> helper function and call it from here and also where
> RO_COMPAT_LARGE_FILE
> is checked. We can probably remove the printk entirely.
Agree.
> > +static loff_t ext3_max_size(int bits, struct super_block *sb)
> > {
> > /* This constant is calculated to be the largest file size for a
> > * dense, 4k-blocksize file such that the total number of
> > * sectors in the file, including data and all indirect blocks,
> > * does not exceed 2^32. */
> > + if (sizeof(blkcnt_t) < sizeof(u64)) {
> > + upper_limit = 0x1ff7fffd000LL;
> > + }
> > + /* With CONFIG_LSF on, file size is limited to
> blocksize*(4G-1) */
> > + else {
> > + upper_limit = (1LL << (bits + 32)) - (1LL << bits);
> > + }
>
> This doesn't take into account that there will be some number of extra
> blocks on the file for {dt}indirect blocks. There was some discussion
> among ext3 developers to use another field in the inode to allow the
> i_blocks count to grow up to 2^48 bits in conjunction with this
> patch, which will remove any worry about additional metadata blocks
> and alsoallow future growth without yet another COMPAT flag.
I'm considering using l_i_frag and l_i_fsize as the high bits of
i_blocks for 48-bits, besides i_blocks in fs blocksize. Is there any
comment?
> > @@ -1699,6 +1706,18 @@ static int ext3_fill_super (struct super
> > + if (EXT3_HAS_RO_COMPAT_FEATURE(sb,
> > + EXT3_FEATURE_RO_COMPAT_HUGE_FILE)) {
> > + if (sizeof(root->i_blocks) < sizeof(u64)) {
> > + if (!(sb->s_flags & MS_RDONLY)) {
> > + printk(KERN_ERR "EXT3-fs: %s:
> Having huge file with "
> > + "LSF off, you
> must mount filesystem "
> > + "read-only.\n",
> sb->s_id);
> > + goto failed_mount;
>
> Instead of indenting so deeply here, this could just be a
> single condition:
Agree.
Thanks a lot, Andreas!
Cheers, sho
next reply other threads:[~2006-05-30 12:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-30 12:25 sho [this message]
2006-05-30 19:17 ` Andreas Dilger
-- strict thread matches above, loose matches on Subject: below --
2006-05-25 12:50 sho
2006-05-26 11:57 ` Andreas Dilger
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=20060530212540sho@rifu.tnes.nec.co.jp \
--to=sho@tnes.nec.co.jp \
--cc=adilger@clusterfs.com \
--cc=cmm@us.ibm.com \
--cc=ext2-devel@lists.sourceforge.net \
--cc=jitendra@linsyssoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®