From: Liu Bo <liubo2009@cn.fujitsu.com>
To: Chris Mason <chris.mason@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 10/10] Btrfs: drop cache with VACANCY em when we fail to start a transaction
Date: Fri, 30 Mar 2012 09:08:35 +0800 [thread overview]
Message-ID: <4F750793.9040402@cn.fujitsu.com> (raw)
In-Reply-To: <20120329140156.GN755@shiny>
On 03/29/2012 10:01 PM, Chris Mason wrote:
> 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?
>
err, sorry, plz drop this one, it's just a cleanup.
I was just thinking when we create a VACANCY em and fail to start a transaction(break out from while loop),
we'll leave a VACANCY em behind.
thanks,
liubo
> -chris
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2012-03-30 1:08 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
2012-03-30 1:08 ` Liu Bo [this message]
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=4F750793.9040402@cn.fujitsu.com \
--to=liubo2009@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.