public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: Mingming Cao <cmm@us.ibm.com>,
	tytso@mit.edu, sandeen@redhat.com, linux-ext4@vger.kernel.org
Subject: Re: [RFC PATCH] ext4: Fix fallocate to update the file size in each transaction.
Date: Sat, 8 Mar 2008 21:42:55 +0530	[thread overview]
Message-ID: <20080308161255.GB6992@skywalker> (raw)
In-Reply-To: <1204905803.7975.17.camel@norville.austin.ibm.com>

On Fri, Mar 07, 2008 at 10:03:23AM -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.

Fixed with the above example added to comment.

Thanks
-aneesh

  parent reply	other threads:[~2008-03-08 16:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07 10:53 [RFC PATCH] ext4: Fix fallocate to update the file size in each transaction Aneesh Kumar K.V
2008-03-07 11:30 ` Mingming Cao
2008-03-07 11:44   ` Aneesh Kumar K.V
2008-03-07 16:03     ` Dave Kleikamp
2008-03-07 17:59       ` Mingming Cao
2008-03-08 16:12       ` Aneesh Kumar K.V [this message]
2008-03-07 15:45 ` Eric Sandeen
2008-03-07 15:57   ` Eric Sandeen
2008-03-08 16:11   ` Aneesh Kumar K.V

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=20080308161255.GB6992@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=shaggy@linux.vnet.ibm.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