linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Mingming <cmm@us.ibm.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] Ext4: avoid multiple quota reservation when retry block reservation for delalloc
Date: Mon, 21 Sep 2009 20:15:27 +0200	[thread overview]
Message-ID: <20090921181527.GA27777@duck.suse.cz> (raw)
In-Reply-To: <1253551950.9099.10.camel@mingming-laptop>

On Mon 21-09-09 09:52:30, Mingming wrote:
> Ext4: release reserved quota before block reservation for delalloc retry
> 
> ext4_da_reserve_space() can reserve quota blocks multiple times if
> ext4_claim_free_blocks() fail and we retry the allocation. We should
> release the quota reservation before restarting.
> 
> Bug found be Jan Kara.
            ^^ by
> 
> Signed-off-by: Mingming Cao <cmm@us.ibm.com>
> 
> ---
>  fs/ext4/inode.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6.31-rc4/fs/ext4/inode.c
> ===================================================================
> --- linux-2.6.31-rc4.orig/fs/ext4/inode.c
> +++ linux-2.6.31-rc4/fs/ext4/inode.c
> @@ -1785,11 +1785,11 @@ repeat:
>  
>  	if (ext4_claim_free_blocks(sbi, total)) {
>  		spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
> +		vfs_dq_release_reservation_block(inode, total);
>  		if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
>  			yield();
>  			goto repeat;
>  		}
> -		vfs_dq_release_reservation_block(inode, total);
>  		return -ENOSPC;
>  	}
>  	EXT4_I(inode)->i_reserved_data_blocks += nrblocks;
> 
  The patch is fine. Acked-by: Jan Kara <jack@suse.cz>
But it's certainly not the issue hit by Pavol but I'm out of ideas where
could be a problem provided he runs with extents...

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2009-09-21 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 16:52 [PATCH] Ext4: avoid multiple quota reservation when retry block reservation for delalloc Mingming
2009-09-21 18:15 ` Jan Kara [this message]
2009-09-21 23:18   ` Mingming
2009-09-28 14:49     ` Theodore Tso

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=20090921181527.GA27777@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=cmm@us.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;
as well as URLs for NNTP newsgroup(s).