From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Edward Thornber <thornber@redhat.com>,
"Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: [PATCH 2/6] dm: introduce dm_accept_partial_bio
Date: Mon, 17 Mar 2014 20:49:52 -0400 [thread overview]
Message-ID: <20140318004951.GD4037@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1403171838380.12877@file01.intranet.prod.int.rdu2.redhat.com>
On Mon, Mar 17 2014 at 6:45pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:
>
>
> On Mon, 17 Mar 2014, Mike Snitzer wrote:
>
> > > > I do however want you to add yet another BUG_ON for any bio that isn't
> > > > meant to be sent to this interface (only one so far is REQ_FLUSH AFAIK).
> > >
> > > Then, it triggers NULL pointer dereference. You don't have to add BUG_ON
> > > for it, it crashes anyway.
> >
> > I understand it'll NULL pointer, but that is _always_ confusing for
> > someone who wasn't the original developer. Please add the explicit
> > BUG_ON() for REQ_FLUSH.
>
> The user will not hit a BUG with REQ_FLUSH. Regarding the developer - it
> is expected that the kernel developer is able to decode the oops message,
> compare it with disassembled code and find out which variable was NULL.
> The function is small, so it's an easy task.
By that logic then no BUG_ON() should ever be needed. You need to know
to quit while you're ahead ;)
> We don't really need
> BUG_ON(!pointer);
> variable = *pointer;
Right, we don't.. but it helps resolve issues quicker if thoughtful
BUG_ON()s hit before more obscure crashes do. Whereby obviating the
need to reverse engineer _why_ the NULL pointer occurred.
next prev parent reply other threads:[~2014-03-18 0:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 22:40 [PATCH 1/6] dm: change sector_t len to unsigned Mikulas Patocka
2014-03-14 22:41 ` [PATCH 2/6] dm: introduce dm_accept_partial_bio Mikulas Patocka
2014-03-14 22:42 ` [PATCH 3/6] dm-snapshot: make the origin target allocate per-target structure Mikulas Patocka
2014-03-14 22:43 ` [PATCH 4/6] dm origin: split only write bios Mikulas Patocka
2014-03-14 22:43 ` [PATCH 5/6] dm: remove num_write_bios Mikulas Patocka
2014-03-14 22:44 ` [PATCH 6/6] dm: introduce dm_ask_for_duplicate_bios Mikulas Patocka
2014-04-25 18:50 ` Mike Snitzer
2014-04-28 15:09 ` Mikulas Patocka
2014-04-28 15:45 ` Mike Snitzer
2014-03-17 13:27 ` [PATCH 2/6] dm: introduce dm_accept_partial_bio Mike Snitzer
2014-03-17 17:08 ` Mikulas Patocka
2014-03-17 17:43 ` Mike Snitzer
2014-03-17 19:09 ` Mike Snitzer
2014-03-17 19:18 ` Mikulas Patocka
2014-03-17 19:47 ` Mike Snitzer
2014-03-17 22:45 ` Mikulas Patocka
2014-03-18 0:49 ` Mike Snitzer [this message]
2014-03-18 1:26 ` Mikulas Patocka
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=20140318004951.GD4037@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@redhat.com \
--cc=thornber@redhat.com \
/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.