linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] Btrfs: fix unexpected balance crash due to BUG_ON
Date: Tue, 12 Jul 2016 14:02:45 +0200	[thread overview]
Message-ID: <20160712120245.GA10595@suse.cz> (raw)
In-Reply-To: <1468257695-22445-1-git-send-email-bo.li.liu@oracle.com>

On Mon, Jul 11, 2016 at 10:21:35AM -0700, Liu Bo wrote:
> +		}
>  
>  		trans = btrfs_start_transaction(dev_root, 0);
> -		BUG_ON(IS_ERR(trans));
> +		if (IS_ERR(trans)) {
> +			ret = PTR_ERR(trans);
> +			btrfs_info(fs_info,

This could be btrfs_info_in_rcu for clarity (using the rcu_string)

> +		 "%s:%d fails on btrfs_start_transaction() right after shrinking devivce %s (original size is %llu new size is %llu",
> +				   __func__, __LINE__,

I'm not sure the function and line is necessary, we don't use it
anywhere else. I'd suggest a slight modification:

		"resize: unable to start transaction after shrinking device %s (error %d), old size %llu, new size %llu"

> +				   rcu_str_deref(device->name), old_size,
> +				   old_size - size_to_free);
> +			goto error;
> +		}
>  
>  		ret = btrfs_grow_device(trans, device, old_size);
> -		BUG_ON(ret);
> +		if (ret) {
> +			btrfs_end_transaction(trans, dev_root);
> +			/* btrfs_grow_device never returns ret > 0 */
> +			WARN_ON(ret > 0);
> +			btrfs_info(fs_info,
> +		 "%s:%d fails on btrfs_grow_device() right after shrinking devivce %s (original size is %llu new size is %llu",

"resize: unable to grow device after shrinking device %s (error %d), old size %llu, new size %llu"

  parent reply	other threads:[~2016-07-12 12:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 17:21 [PATCH v2] Btrfs: fix unexpected balance crash due to BUG_ON Liu Bo
2016-07-11 20:39 ` Chris Mason
2016-07-12  8:45 ` Filipe Manana
2016-07-12 12:02 ` David Sterba [this message]
2016-07-12 18:24 ` [PATCH v3] " Liu Bo
2016-07-15 15:38   ` 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=20160712120245.GA10595@suse.cz \
    --to=dsterba@suse.cz \
    --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).