Re: Should block-number-in-file vars be using blkcnt_t?

"Takashi Sato" <[email protected]> Wed, 23 Aug 2006 15:17:11 +0900
Newsgroups gmane.comp.file-systems.ext2.devel
Message-ID <[email protected]>
Eric Sandeen wrote:
> Looking over Takashi's patches, I think that this is all that remains to fix up the
> 32-bit containers in kernelspace.  If this patch (based on Takashi's patches)
> looks acceptable, I'll submit it upstream.
>
> A few comments/questions:
>
> As Andreas noted, the changes to balloc.c aren't really necessary; underflow will
> save us.  But I like the notion of not overflowing/underflowing if we can help it.
> :)
>
> I changed Takashi's resize checks to not cast up to 64 bits, I think the tests
> below will catch overflows w/o the casting, and will work when we go to 64-bit
> block containers.  The warning message is a little cryptic, but it's simple.  :)
> Is "EPERM" what we want to return when the resize request is too large?

EPERM was returned in my patch referring to the following original
code in ext3_group_extend().  However, I think that EINVAL is
more appropriate so far.

linux/fs/ext3/resize.c:
---------------------------------------------------------------------------
/* Handle the remaining blocks in the last group only. */
 last = (o_blocks_count - le32_to_cpu(es->s_first_data_block)) %
  EXT3_BLOCKS_PER_GROUP(sb);

 if (last == 0) {
  ext3_warning(sb, __FUNCTION__,
        "need to use ext2online to resize further");
  return -EPERM;
 }
----------------------------------------------------------------------------

I have reviewed your patch.
I think your patch is correct except returning EPERM as above.

Eric Sandeen wrote:
> But as the filesystem gets bigger, can't we fit more inodes in,
> potentially overflowing 31 bits?  I guess I need to go look at the
> ratios and mkfs thresholds again ...
>
> Hmm but you're right, I have not audited inode number containers in
> general...

My patches(*1) already support >2^31 inode number.
I hope it is useful for you.

*1: "extend file size and filesystem size" on May 5

Cheers, Takashi

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642