Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Jeff Mahoney <jeffm@suse.com>
Cc: Josef Bacik <jbacik@fusionio.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: add support for asserts
Date: Tue, 27 Aug 2013 16:21:19 -0500	[thread overview]
Message-ID: <521D184F.5060407@redhat.com> (raw)
In-Reply-To: <521D14FF.9090604@suse.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/27/13 4:07 PM, Jeff Mahoney wrote:
> On 8/27/13 4:56 PM, Josef Bacik wrote:
>> On Tue, Aug 27, 2013 at 03:28:24PM -0400, Jeff Mahoney wrote:
>>> On 8/26/13 4:56 PM, Josef Bacik wrote:
>>>> One of the complaints we get a lot is how many BUG_ON()'s we have.  So to help
>>>> with this I'm introducing a kconfig option to enable/disable a new ASSERT()
>>>> mechanism much like what XFS does.  This will allow us developers to still get
>>>> our nice panics but allow users/distros to compile them out.  With this we can
>>>> go through and convert any BUG_ON()'s that we have to catch actual programming
>>>> mistakes to the new ASSERT() and then fix everybody else to return errors.  This
>>>> will also allow developers to leave sanity checks in their new code to make sure
>>>> we don't trip over problems while testing stuff and vetting new features.
>>>> Thanks,
>>>
>>> I don't think the complaint is so much about the number of BUG_ONs, but
>>> that there's no distinction between something that is supposed to be
>>> impossible and something that is improbable. The BUG_ONs to keep code
>>> correctness are good and are littered all over the kernel with positive
>>> results. The BUG_ONs that are there in place of real error handling
>>> served their purpose and need to be replaced.
>>>
>>> So, I don't know if it's a net win to compile the "good" BUG_ONs out of
>>> the code. Especially if a user runs into something strange yet familiar
>>> and the first response is "oh, huh, can you rebuild with asserts enabled?"
>>>
>>
>> Either I provide an option for it or distros do it themselves, this cuts out the
>> middle man.  I'd really rather they just be on all the time since they aren't
>> things we should hit anyway, but at least this way people have a choice.
> 
> Ok. With my distro hat on, I can tell you I'll be leaving them on. :)
> 
> -Jeff

XFS also has XFS_WARN as a config option, which keeps all the assertions
in place, but printk's & backtraces w/o the icky BUG().  That might be
good to add as well, and perhaps best for a shipping distro (vs. a developer
debugging who might want to drop a core file when the assert trips).

- -Eric

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSHRhOAAoJECCuFpLhPd7gYbcP/034ADG3dwTa83FaAWuAurg7
byKWG4EwRqt3PYjUgruxBJAc426O7tz6j1NNTrAwZys9/GJOsisPShA8gO0f+W/A
+bQZJlXoUMbbwVPMcCqsnKMKlXNyKoqgME9AUQOrzMB/SgDtC9Y/OgdqgWF/58UV
X1KC3OOtcfQr/1t19AZuNhJ5oHfytoscv3nnnW5872t1JtL8daomak4fyDuRKgRV
45kQ726nafUlXNmi1TG8GadlcmKxxbBm0vt2ui6RtZWVauPE4Gej+iEUux9WtwSc
48eOQ5iqbFVzC8v++Rc1eT28mBIjSetr+O/Tk+VL4TvYCKA2trMAltNAFinv9AB0
Q+Z9F1K26aFe/Z/gcM57j+c0VOkv1tvSElF1iJcVHPuRvV7k+548g+KVzbXNDPBP
vuV2fnUCpw/XHQlrI+efYLs7Ies0TuV2eGPhmbKWjhossPwOeng71zxuiXSbNMBE
gVcHg6idXjCdaCCIYuJr8+5K4ngnpTEbAUs4C2x6iHzuHZcXScEHWYU/nHvizElL
bCZ162QSeQZAd+NgSzoZSmv4XqFMj6c4q60XvhAuu3fpkVPVY4GshcFhT14Onhfl
/054HqdQIXjUGOdbeuUwmXoaqzpSKDhBmZ0G+ykarD1KRCaEW61JrnFepRPO7G69
Q3oiPIbvdvCw3BZAJaGL
=7vvX
-----END PGP SIGNATURE-----

  reply	other threads:[~2013-08-27 21:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 20:56 [PATCH] Btrfs: add support for asserts Josef Bacik
2013-08-26 21:21 ` Eric Sandeen
2013-08-26 21:53 ` Zach Brown
2013-08-26 22:02   ` Eric Sandeen
2013-08-26 22:09     ` Zach Brown
2013-08-27 13:47   ` Josef Bacik
2013-08-27 19:23     ` Jeff Mahoney
2013-08-27 19:28 ` Jeff Mahoney
2013-08-27 20:56   ` Josef Bacik
2013-08-27 21:07     ` Jeff Mahoney
2013-08-27 21:21       ` Eric Sandeen [this message]
2013-08-27 21:25         ` Jeff Mahoney
2013-08-27 21:28           ` Eric Sandeen
2013-08-27 21:38             ` Jeff Mahoney
2013-08-28 16:32 ` 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=521D184F.5060407@redhat.com \
    --to=sandeen@redhat.com \
    --cc=jbacik@fusionio.com \
    --cc=jeffm@suse.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