Matthew Wilcox writes:
> On Mon, Mar 12, 2001 at 01:47:54PM -0700, Andreas Dilger wrote:
> > Yes, I sent in a patch about this as well (don't think it is in kernel
> > yet).  HOWEVER, there is also a bug related to this - for checking
> > LARGEFILE, we only check raw_inode->i_size_high, and not bit 31 of
> > inode->i_size.  This was also in my original patch.
> 
> > >           raw_inode->i_size_high = cpu_to_le32(inode->i_size >> 32);
> > >           if (raw_inode->i_size_high) {
> > > -                 struct super_block *sb = inode->i_sb;
> > >                   if (!EXT2_HAS_RO_COMPAT_FEATURE(sb,
> > >                                   EXT2_FEATURE_RO_COMPAT_LARGE_FILE) ||
> > 
> > This is where we need to check bit 31 for LFS:
> > 
> > -           if (raw_inode->i_size_high) {
> > +           if (raw_inode->i_size_high || inode->i_size & 0x80000000) {
> 
> surely better to check
> 
>               if (inode->i_size >= 0x80000000)
> 
> after all, it's what you mean.

Probably true.  For that matter, it should be (inode->i_size > 0x7fffffffULL)
for consistency with checks in the 2.2 LFS code.

However, I picked the above test, because it makes a few instructions less
work on 32-bit systems: i_size_high has already been calculated, so we
are only interested in the high bit of the low word.

I don't care much either way.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to