Messages in this thread | | | From | xiaoshoukui <> | Subject | Re: [PATCH] btrfs: fix BUG_ON condition in btrfs_cancel_balance | Date | Thu, 17 Aug 2023 23:02:39 -0400 |
| |
> 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.
| |