linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: The future of ubi_assert()
Date: Wed, 05 Nov 2014 23:02:22 +0100	[thread overview]
Message-ID: <545A9E6E.3000208@nod.at> (raw)

Artem,

I'm not happy with ubi_assert().
Currently it only prints a warning and a stack trace but execution
continues. In production nobody will notice and while developing turning
it into a plain BUG_ON is most of the time more useful because execution stops
exactly where the boo boo happens one can analyze stack/registers.

I propose splitting ubi_assert() into two new functions.

1. ubi_bug_on()
Basically a BUG_ON(), it shall be used for assertions where execution of
UBI cannot proceed and anything we can do is crashing the machine.

2. ubi_warn_on()
This macro shall be used for assertions where further execution is possible
in read-only mode. ubi_warn_on() would be a WARN_ON() plus ubi_ro_mode().

I'm sure that the vast majority of all ubi_asserts() can be turned into a ubi_warn_on().

What do you think?

Thanks,
//richard

             reply	other threads:[~2014-11-05 22:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 22:02 Richard Weinberger [this message]
2014-11-06  7:21 ` The future of ubi_assert() Artem Bityutskiy
2014-11-06  8:07   ` Richard Weinberger
2014-11-06  8:13     ` Artem Bityutskiy
2014-11-06  8:16       ` Richard Weinberger

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=545A9E6E.3000208@nod.at \
    --to=richard@nod.at \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.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).