linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Josef Bacik <jbacik@fb.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] Btrfs: handle quota reserve failure properly
Date: Mon, 19 Sep 2016 14:50:09 -0400	[thread overview]
Message-ID: <d4cc1bae-bbfa-e29c-9eeb-75f7cc1876fe@suse.com> (raw)
In-Reply-To: <1473965868-9675-1-git-send-email-jbacik@fb.com>


[-- Attachment #1.1: Type: text/plain, Size: 1280 bytes --]

On 9/15/16 2:57 PM, Josef Bacik wrote:
> btrfs/022 was spitting a warning for the case that we exceed the quota.  If we
> fail to make our quota reservation we need to clean up our data space
> reservation.  Thanks,
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
>  fs/btrfs/extent-tree.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 03da2f6..d72eaae 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -4286,13 +4286,10 @@ int btrfs_check_data_free_space(struct inode *inode, u64 start, u64 len)
>  	if (ret < 0)
>  		return ret;
>  
> -	/*
> -	 * Use new btrfs_qgroup_reserve_data to reserve precious data space
> -	 *
> -	 * TODO: Find a good method to avoid reserve data space for NOCOW
> -	 * range, but don't impact performance on quota disable case.
> -	 */
> +	/* Use new btrfs_qgroup_reserve_data to reserve precious data space. */
>  	ret = btrfs_qgroup_reserve_data(inode, start, len);
> +	if (ret)
> +		btrfs_free_reserved_data_space_noquota(inode, start, len);
>  	return ret;
>  }
>  
> 

Tested-by: Jeff Mahoney <jeffm@suse.com>

btrfs/022 passes now.

Thanks,

-Jeff

-- 
Jeff Mahoney
SUSE Labs


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 881 bytes --]

  parent reply	other threads:[~2016-09-19 18:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 18:57 [PATCH] Btrfs: handle quota reserve failure properly Josef Bacik
2016-09-16  9:02 ` Holger Hoffstätte
2016-09-19 18:08   ` David Sterba
2016-09-20  0:33     ` Qu Wenruo
2016-09-19 18:50 ` Jeff Mahoney [this message]
2016-09-20  0:35   ` Chris Mason

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=d4cc1bae-bbfa-e29c-9eeb-75f7cc1876fe@suse.com \
    --to=jeffm@suse.com \
    --cc=jbacik@fb.com \
    --cc=kernel-team@fb.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).