All of lore.kernel.org
 help / color / mirror / Atom feed
From: xiaoshoukui <xiaoshoukui@gmail.com>
To: dsterba@suse.cz
Cc: clm@fb.com, dsterba@suse.com, josef@toxicpanda.com,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	xiaoshoukui@gmail.com, xiaoshoukui@ruijie.com.cn
Subject: Re: [PATCH] btrfs: fix BUG_ON condition in btrfs_cancel_balance
Date: Thu, 17 Aug 2023 23:02:39 -0400	[thread overview]
Message-ID: <20230818030239.39524-1-xiaoshoukui@gmail.com> (raw)
In-Reply-To: <20230817121135.GL2420@twin.jikos.cz>

> Seems that it's from times the balance was not cancellable the same way
> as now. Also it's a good time to switch the BUG_ON to an assertion or
> handle it properly.

That's the point. Canceling the balance only takes into account the normal scenarios.
Replacing the BUG ON here with an assertion would make the code cleaner.

> I'll change to to ASSERT, this is really to verify that the state
> tracking works properly.

The ASSERT and BUG ON macros have already helped us uncover many hidden issues. 

      reply	other threads:[~2023-08-18  3:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15  6:55 [PATCH] btrfs: fix BUG_ON condition in btrfs_cancel_balance xiaoshoukui
2023-08-17 12:11 ` David Sterba
2023-08-18  3:02   ` xiaoshoukui [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=20230818030239.39524-1-xiaoshoukui@gmail.com \
    --to=xiaoshoukui@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiaoshoukui@ruijie.com.cn \
    /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.