All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/6] btrfs-progs: Exit gracefull when we failed to alloc dev extent
Date: Wed, 29 Aug 2018 17:59:55 +0300	[thread overview]
Message-ID: <272db467-82b6-4f2b-8bcf-e6e16a666778@suse.com> (raw)
In-Reply-To: <20180803055022.9816-6-wqu@suse.com>



On  3.08.2018 08:50, Qu Wenruo wrote:
> Another BUG_ON() during fuzz/003:
> ------
> ====== RUN MAYFAIL /home/adam/btrfs/btrfs-progs/btrfs check --repair /home/adam/btrfs/btrfs-progs/tests//fuzz-tests/images/bko-199833-reloc-recovery-crash.raw.restored
> [1/7] checking root items
> Fixed 0 roots.
> [2/7] checking extents
> ctree.c:1650: leaf_space_used: Warning: assertion `data_len < 0` failed, value 1
> bad key ordering 18 19
> bad block 29409280
> ERROR: errors found in extent allocation tree or chunk allocation
> WARNING: minor unaligned/mismatch device size detected
> WARNING: recommended to use 'btrfs rescue fix-device-size' to fix it
> [3/7] checking free space cache
> [4/7] checking fs roots
> ctree.c:1650: leaf_space_used: Warning: assertion `data_len < 0` failed, value 1
> bad key ordering 18 19
> root 18446744073709551608 missing its root dir, recreating
> Unable to find block group for 0
> Unable to find block group for 0
> Unable to find block group for 0
> volumes.c:564: btrfs_alloc_dev_extent: BUG_ON `ret` triggered, value -28
> failed (ignored, ret=134): /home/adam/btrfs/btrfs-progs/btrfs check --repair /home/adam/btrfs/btrfs-progs/tests//fuzz-tests/images/bko-199833-reloc-recovery-crash.raw.restored
> mayfail: returned code 134 (SIGABRT), not ignored
> test failed for case 003-multi-check-unmounted
> ------
> 
> However the culprit function btrfs_alloc_dev_extent() has proper error
> handler tag err:, just use that tag would solve the problem easily.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  volumes.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/volumes.c b/volumes.c
> index d81b348eb14d..f7a413b71d52 100644
> --- a/volumes.c
> +++ b/volumes.c
> @@ -561,7 +561,8 @@ static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
>  	key.type = BTRFS_DEV_EXTENT_KEY;
>  	ret = btrfs_insert_empty_item(trans, root, path, &key,
>  				      sizeof(*extent));
> -	BUG_ON(ret);
> +	if (ret < 0)
> +		goto err;
>  
>  	leaf = path->nodes[0];
>  	extent = btrfs_item_ptr(leaf, path->slots[0],
> 

  reply	other threads:[~2018-08-29 18:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03  5:50 [PATCH 0/6] btrfs-progs: Variant fixes for fuzz-tests Qu Wenruo
2018-08-03  5:50 ` [PATCH 1/6] btrfs-progs: Exit gracefully if we hit ENOSPC when allocating tree block Qu Wenruo
2018-08-29 14:30   ` Nikolay Borisov
2018-08-03  5:50 ` [PATCH 2/6] btrfs-progs: Exit gracefully when failed to repair root dir item Qu Wenruo
2018-08-29 14:31   ` Nikolay Borisov
2018-08-03  5:50 ` [PATCH 3/6] btrfs-progs: Don't report dirty leaked eb using BUG_ON Qu Wenruo
2018-08-29 14:52   ` Nikolay Borisov
2018-08-30  1:08     ` Qu Wenruo
2018-08-03  5:50 ` [PATCH 4/6] btrfs-progs: Fix infinite loop when failed to repair bad key order Qu Wenruo
2018-08-03  5:50 ` [PATCH 5/6] btrfs-progs: Exit gracefull when we failed to alloc dev extent Qu Wenruo
2018-08-29 14:59   ` Nikolay Borisov [this message]
2018-08-03  5:50 ` [PATCH 6/6] btrfs-progs: rescue-super: Don't double free fs_devices Qu Wenruo
2018-08-29 15:38   ` Nikolay Borisov
2018-08-30  1:16     ` Qu Wenruo
2018-08-29  5:27 ` [PATCH 0/6] btrfs-progs: Variant fixes for fuzz-tests Qu Wenruo
2018-09-11 16:38   ` David Sterba
2018-09-11 23:59     ` Qu Wenruo
2018-09-14 14:25       ` David Sterba

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=272db467-82b6-4f2b-8bcf-e6e16a666778@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 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.