linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Liu Bo <liubo2009@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 10/10] Btrfs: drop cache with VACANCY em when we fail to start a transaction
Date: Thu, 29 Mar 2012 10:01:56 -0400	[thread overview]
Message-ID: <20120329140156.GN755@shiny> (raw)
In-Reply-To: <1332830678-3992-11-git-send-email-liubo2009@cn.fujitsu.com>

On Tue, Mar 27, 2012 at 02:44:38PM +0800, Liu Bo wrote:
> We need to clean a VACANCY em(if we have) when we fail to start a transaction.
> 
> Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
> ---
>  fs/btrfs/inode.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index bacf441..2b2f0b6 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -3406,9 +3406,6 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
>  				break;
>  			}
>  
> -			btrfs_drop_extent_cache(inode, hole_start,
> -					last_byte - 1, 0);
> -
>  			btrfs_update_inode(trans, root, inode);
>  			btrfs_end_transaction(trans, root);
>  		}
> @@ -3419,6 +3416,9 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
>  			break;
>  	}
>  
> +	if (em && test_bit(EXTENT_FLAG_VACANCY, &em->flags))
> +		btrfs_drop_extent_cache(inode, hole_start, last_byte - 1, 0);
> +

Hmmm, last_byte isn't always setup at this point (uninit variable).  I'm
a little uncertain about what this one is fixing?

-chris

  reply	other threads:[~2012-03-29 14:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27  6:44 [PATCH 00/10] several fixes and cleanups Liu Bo
2012-03-27  6:44 ` [PATCH 01/10] Btrfs: show useful info in space reservation tracepoint Liu Bo
2012-03-27  6:44 ` [PATCH 02/10][RESEND] Btrfs: fix deadlock during allocating chunks Liu Bo
2012-03-27  6:44 ` [PATCH 03/10] Btrfs: fix race between direct io and autodefrag Liu Bo
2012-03-27  6:44 ` [PATCH 04/10] Btrfs: fix the mismatch of page->mapping Liu Bo
2012-03-27  6:44 ` [PATCH 05/10][RESEND] Btrfs: fix recursive defragment with autodefrag option Liu Bo
2012-03-27  6:44 ` [PATCH 06/10] Btrfs: add a check to decide if we should defrag the range Liu Bo
2012-03-27  6:44 ` [PATCH 07/10] Btrfs: do not bother to defrag an extent if it is a big real extent Liu Bo
2012-03-27  6:44 ` [PATCH 08/10] Btrfs: update to the right index of defragment Liu Bo
2012-03-27  6:44 ` [PATCH 09/10] Btrfs: use PagePrivate2 to check ordered data Liu Bo
2012-03-27  6:44 ` [PATCH 10/10] Btrfs: drop cache with VACANCY em when we fail to start a transaction Liu Bo
2012-03-29 14:01   ` Chris Mason [this message]
2012-03-30  1:08     ` Liu Bo

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=20120329140156.GN755@shiny \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liubo2009@cn.fujitsu.com \
    /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).