linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Liu Bo <bo.li.liu@oracle.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] Btrfs: release subvolume's block_rsv before transaction commit
Date: Wed, 8 Jan 2014 10:22:18 -0500	[thread overview]
Message-ID: <52CD6D2A.9090900@fb.com> (raw)
In-Reply-To: <1388324691-24507-2-git-send-email-bo.li.liu@oracle.com>


On 12/29/2013 08:44 AM, Liu Bo wrote:
> We don't have to keep subvolume's block_rsv during transaction commit,
> and within transaction commit, we may also need the free space reclaimed
> from this block_rsv to process delayed refs.
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>   fs/btrfs/ioctl.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 21da576..347bf61 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -417,7 +417,8 @@ static noinline int create_subvol(struct inode *dir,
>   	trans = btrfs_start_transaction(root, 0);
>   	if (IS_ERR(trans)) {
>   		ret = PTR_ERR(trans);
> -		goto out;
> +		btrfs_subvolume_release_metadata(root, &block_rsv, qgroup_reserved);
> +		return ret;
>   	}
>   	trans->block_rsv = &block_rsv;
>   	trans->bytes_reserved = block_rsv.size;
> @@ -542,6 +543,8 @@ static noinline int create_subvol(struct inode *dir,
>   fail:
>   	trans->block_rsv = NULL;
>   	trans->bytes_reserved = 0;
> +	btrfs_subvolume_release_metadata(root, &block_rsv, qgroup_reserved);
> +
>   	if (async_transid) {
>   		*async_transid = trans->transid;
>   		err = btrfs_commit_transaction_async(trans, root, 1);
> @@ -555,8 +558,6 @@ fail:
>   
>   	if (!ret)
>   		d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));
> -out:
> -	btrfs_subvolume_release_metadata(root, &block_rsv, qgroup_reserved);
>   	return ret;
>   }
>   

Doesn't compile, please rebase onto new btrfs-next and resubmit. Thanks,

Josef

  reply	other threads:[~2014-01-08 15:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29 13:44 [PATCH 1/2] Btrfs: return free space to global_rsv as much as possible Liu Bo
2013-12-29 13:44 ` [PATCH 2/2] Btrfs: release subvolume's block_rsv before transaction commit Liu Bo
2014-01-08 15:22   ` Josef Bacik [this message]
2014-01-09  6:57     ` [PATCH v2] " 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=52CD6D2A.9090900@fb.com \
    --to=jbacik@fb.com \
    --cc=bo.li.liu@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 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).