public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	dm-devel@redhat.com, linux-kernel@vger.kernel.org,
	mpatocka@redhat.com
Subject: Re: [RFC PATCH] bio integrity: do not assume bio_integrity_pool exists if bioset exists
Date: Tue, 7 Jul 2015 09:57:21 -0400	[thread overview]
Message-ID: <20150707135721.GA16040@redhat.com> (raw)
In-Reply-To: <559BD866.6030305@kernel.dk>

On Tue, Jul 07 2015 at  9:47am -0400,
Jens Axboe <axboe@kernel.dk> wrote:

> On 07/01/2015 10:57 AM, Mike Snitzer wrote:
> >bio_integrity_alloc() and bio_integrity_free() assume that if a bio was
> >allocated from a bioset that that bioset also had its bio_integrity_pool
> >allocated using bioset_integrity_create().  This is a very bad
> >assumption given that bioset_create() and bioset_integrity_create() are
> >completely disjoint.  Not all callers of bioset_create() have been
> >trained to also call bioset_integrity_create() -- and they may not care
> >to be.
> >
> >Fix this by falling back to kmalloc'ing 'struct bio_integrity_payload'
> >rather than force all bioset consumers to (wastefully) preallocate a
> >bio_integrity_pool that they very likely won't actually need (given the
> >niche nature of the current block integrity support).
> >
> >Otherwise, a NULL pointer "Kernel BUG" with a trace like the following
> >will be observed (as seen on s390x using zfcp storage) because dm-io
> >doesn't use bioset_integrity_create() when creating its bioset:
> >
> >     [  791.643338] Call Trace:
> >     [  791.643339] ([<00000003df98b848>] 0x3df98b848)
> >     [  791.643341]  [<00000000002c5de8>] bio_integrity_alloc+0x48/0xf8
> >     [  791.643348]  [<00000000002c6486>] bio_integrity_prep+0xae/0x2f0
> >     [  791.643349]  [<0000000000371e38>] blk_queue_bio+0x1c8/0x3d8
> >     [  791.643355]  [<000000000036f8d0>] generic_make_request+0xc0/0x100
> >     [  791.643357]  [<000000000036f9b2>] submit_bio+0xa2/0x198
> >     [  791.643406]  [<000003ff801f9774>] dispatch_io+0x15c/0x3b0 [dm_mod]
> >     [  791.643419]  [<000003ff801f9b3e>] dm_io+0x176/0x2f0 [dm_mod]
> >     [  791.643423]  [<000003ff8074b28a>] do_reads+0x13a/0x1a8 [dm_mirror]
> >     [  791.643425]  [<000003ff8074b43a>] do_mirror+0x142/0x298 [dm_mirror]
> >     [  791.643428]  [<0000000000154fca>] process_one_work+0x18a/0x3f8
> >     [  791.643432]  [<000000000015598a>] worker_thread+0x132/0x3b0
> >     [  791.643435]  [<000000000015d49a>] kthread+0xd2/0xd8
> >     [  791.643438]  [<00000000005bc0ca>] kernel_thread_starter+0x6/0xc
> >     [  791.643446]  [<00000000005bc0c4>] kernel_thread_starter+0x0/0xc
> >
> >Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> >Cc: stable@vger.kernel.org
> >---
> >  block/bio-integrity.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Applied for this series.

Awesome, thanks.

  reply	other threads:[~2015-07-07 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 16:57 [RFC PATCH] bio integrity: do not assume bio_integrity_pool exists if bioset exists Mike Snitzer
2015-07-07  5:00 ` Mike Snitzer
2015-07-07 13:47 ` Jens Axboe
2015-07-07 13:57   ` Mike Snitzer [this message]
2015-07-08  0:19 ` Martin K. Petersen
2015-07-14 17:48 ` 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=20150707135721.GA16040@redhat.com \
    --to=snitzer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mpatocka@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox