[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1204912758.14884.0.camel@localhost.localdomain>
Date: Fri, 07 Mar 2008 09:59:18 -0800
From: Mingming Cao <cmm@...ibm.com>
To: Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
tytso@....edu, sandeen@...hat.com, linux-ext4@...r.kernel.org
Subject: Re: [RFC PATCH] ext4: Fix fallocate to update the file size in
each transaction.
On Fri, 2008-03-07 at 10:03 -0600, Dave Kleikamp wrote:
> On Fri, 2008-03-07 at 17:14 +0530, Aneesh Kumar K.V wrote:
> > On Fri, Mar 07, 2008 at 03:30:57AM -0800, Mingming Cao wrote:
> > > On Fri, 2008-03-07 at 16:23 +0530, Aneesh Kumar K.V wrote:
>
> > > > @@ -2814,8 +2834,7 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len)
> > > > return -ENODEV;
> > > >
> > > > block = offset >> blkbits;
> > > > - max_blocks = (EXT4_BLOCK_ALIGN(len + offset, blkbits) >> blkbits)
> > > > - - block;
> > > > + max_blocks = EXT4_BLOCK_ALIGN(len, blkbits) >> blkbits;
> > > >
> > >
> > > Not sure about this change... Other than this looks fine to me
> > >
> >
> > max_blocks actually represented the number of blocks that we are
> > requesting. The above change makes it simple.
>
> I think it's too simple. :-(
>
> Take an example of an empty file (no allocated blocks), offset=0xC00,
> length = 0x800, block_size = 0x1000.
>
> The existing code will result in max_blocks = 2, accounting for both the
> blocks that the allocation spans, but your new code will result in
> max_blocks = 1.
I agree with you.
Mingming
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists