From: Mike Snitzer <snitzer@redhat.com>
To: James Johnston <johnstonj.public@codenest.com>
Cc: 'Mikulas Patocka' <mpatocka@redhat.com>,
"'Alasdair G. Kergon'" <agk@redhat.com>,
'Josef Bacik' <jbacik@fb.com>,
'Eric Wheeler' <bcache@lists.ewheeler.net>,
dm-crypt@saout.de, dm-devel@redhat.com,
'Neil Brown' <neilb@suse.com>,
linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org,
'Kent Overstreet' <kent.overstreet@gmail.com>,
'Tim Small' <tim@buttersideup.com>
Subject: Re: [dm-crypt] dm-log-writes: fix bug with too large bios
Date: Wed, 1 Jun 2016 10:02:43 -0400 [thread overview]
Message-ID: <20160601140243.GC30759@redhat.com> (raw)
In-Reply-To: <07bf01d1bbbd$53991750$facb45f0$@codenest.com>
On Wed, Jun 01 2016 at 12:23am -0400,
James Johnston <johnstonj.public@codenest.com> wrote:
> Hi Mikulas,
>
> > bio_alloc can allocate a bio with at most BIO_MAX_PAGES (256) vector
> > entries. However, the incoming bio may have more vector entries if it was
> > allocated by other means. For example, bcache submits bios with more than
> > BIO_MAX_PAGES entries. This results in bio_alloc failure.
> >
> > To avoid the failure, change the code so that it allocates bio with at
> > most BIO_MAX_PAGES entries. If the incoming bio has more entries,
> > bio_add_page will fail and a new bio will be allocated - the code that
> > handles bio_add_page failure already exists in the dm-log-writes target.
> >
> > Also, move atomic_inc(&lc->io_blocks) before bio_alloc to fix a bug that
> > the target hangs if bio_alloc fails. The error path does put_io_block(lc),
> > so we must do atomic_inc(&lc->io_blocks) before invoking the error path to
> > avoid underflow of lc->io_blocks.
> >
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > Cc: stable@vger.kernel.org # v4.1+
>
> How does this relate to the previous patch you made to dm-crypt? How best
> should I test this? It looks like the dm-crypt patch fixed the problem.
>
> Should I test by applying this patch ONLY and reverting the dm-crypt patch?
> (i.e. does this patch also fix the problem.) Or should I just test with
> both patches applied simultaneously?
The dm-log-writes patch has nothing to do with the dm-crypt patch. It
is just that both targets have comparable issues with bcache issuing
really large bios.
WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: James Johnston <johnstonj.public@codenest.com>
Cc: 'Mikulas Patocka' <mpatocka@redhat.com>,
"'Alasdair G. Kergon'" <agk@redhat.com>,
'Josef Bacik' <jbacik@fb.com>,
'Eric Wheeler' <bcache@lists.ewheeler.net>,
dm-crypt@saout.de, dm-devel@redhat.com,
'Neil Brown' <neilb@suse.com>,
linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org,
'Kent Overstreet' <kent.overstreet@gmail.com>,
'Tim Small' <tim@buttersideup.com>
Subject: Re: dm-log-writes: fix bug with too large bios
Date: Wed, 1 Jun 2016 10:02:43 -0400 [thread overview]
Message-ID: <20160601140243.GC30759@redhat.com> (raw)
In-Reply-To: <07bf01d1bbbd$53991750$facb45f0$@codenest.com>
On Wed, Jun 01 2016 at 12:23am -0400,
James Johnston <johnstonj.public@codenest.com> wrote:
> Hi Mikulas,
>
> > bio_alloc can allocate a bio with at most BIO_MAX_PAGES (256) vector
> > entries. However, the incoming bio may have more vector entries if it was
> > allocated by other means. For example, bcache submits bios with more than
> > BIO_MAX_PAGES entries. This results in bio_alloc failure.
> >
> > To avoid the failure, change the code so that it allocates bio with at
> > most BIO_MAX_PAGES entries. If the incoming bio has more entries,
> > bio_add_page will fail and a new bio will be allocated - the code that
> > handles bio_add_page failure already exists in the dm-log-writes target.
> >
> > Also, move atomic_inc(&lc->io_blocks) before bio_alloc to fix a bug that
> > the target hangs if bio_alloc fails. The error path does put_io_block(lc),
> > so we must do atomic_inc(&lc->io_blocks) before invoking the error path to
> > avoid underflow of lc->io_blocks.
> >
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > Cc: stable@vger.kernel.org # v4.1+
>
> How does this relate to the previous patch you made to dm-crypt? How best
> should I test this? It looks like the dm-crypt patch fixed the problem.
>
> Should I test by applying this patch ONLY and reverting the dm-crypt patch?
> (i.e. does this patch also fix the problem.) Or should I just test with
> both patches applied simultaneously?
The dm-log-writes patch has nothing to do with the dm-crypt patch. It
is just that both targets have comparable issues with bcache issuing
really large bios.
next prev parent reply other threads:[~2016-06-01 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 14:51 [dm-crypt] [PATCH] dm-log-writes: fix bug with too large bios Mikulas Patocka
2016-05-27 14:51 ` Mikulas Patocka
2016-05-27 15:36 ` [dm-crypt] " Josef Bacik
2016-05-27 15:36 ` Josef Bacik
2016-06-01 4:23 ` [dm-crypt] " James Johnston
2016-06-01 4:23 ` James Johnston
2016-06-01 14:02 ` Mike Snitzer [this message]
2016-06-01 14:02 ` Mike Snitzer
2016-06-01 17:32 ` [dm-crypt] [PATCH] " Mikulas Patocka
2016-06-01 17:32 ` 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=20160601140243.GC30759@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=bcache@lists.ewheeler.net \
--cc=dm-crypt@saout.de \
--cc=dm-devel@redhat.com \
--cc=jbacik@fb.com \
--cc=johnstonj.public@codenest.com \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=neilb@suse.com \
--cc=tim@buttersideup.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.