public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Theodore Tso <tytso@mit.edu>,
	ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: Patches for the patchqueue
Date: Thu, 05 Jun 2008 11:02:40 -0700	[thread overview]
Message-ID: <1212688960.3613.10.camel@localhost.localdomain> (raw)
In-Reply-To: <20080605095510.GH8942@skywalker>

On Thu, 2008-06-05 at 15:25 +0530, Aneesh Kumar K.V wrote:
> f) clear the delay bit in ext4_da_get_block_write instead of
> __block_write_full_page
> so that we clear the delay bit for every successfull block allocation.
> We may fail
> while marking inode dirty in ext4_da_get_block_write after allocating
> block. So
> it is better to clear the delay bit in ext4_da_get_block_write rather
> than
> __block_write_full_page
> 

> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---

> @@ -1555,7 +1565,15 @@ static int ext4_da_get_block_write(struct inode
> *inode, sector_t iblock,
>                 bh_result->b_size = (ret << inode->i_blkbits);
> 
>                 /* release reserved-but-unused meta blocks */
> -               ext4_da_release_space(inode, ret, 0);
> +               if (buffer_delay(bh_result)) {
> +                       ext4_da_release_space(inode, ret, 0);
> +                       /*
> +                        * clear the delay bit now that we allocated
> +                        * blocks. If it is not a single block request
> +                        * we clear the delay bit in
> mpage_put_bnr_to_bhs
> +                        */
> +                       clear_buffer_delay(bh_result);
> +               }
> 
>                 /*
>                  * Update on-disk size along with block allocation

It seems with this fix, the buffer_delay bit is still cleared before the
ext4_mark_inode_dirty() could return error? Actually the already
allocated blocks are leaked if mark_inode-dirty() returns error, and we
cleared the buffer_delay for the buffer needs block.

Mingming


  reply	other threads:[~2008-06-05 18:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  9:50 Patches for the patchqueue Aneesh Kumar K.V
2008-06-05  9:51 ` Aneesh Kumar K.V
2008-06-05  9:53   ` Aneesh Kumar K.V
2008-06-05  9:55     ` Aneesh Kumar K.V
2008-06-05 18:02       ` Mingming Cao [this message]
2008-06-05 18:59         ` Aneesh Kumar K.V
2008-06-05 18:51     ` Andreas Dilger
  -- strict thread matches above, loose matches on Subject: below --
2008-06-06 18:24 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=1212688960.3613.10.camel@localhost.localdomain \
    --to=cmm@us.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --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