From: "James Johnston" <johnstonj.public@codenest.com>
To: 'Mikulas Patocka' <mpatocka@redhat.com>,
"'Alasdair G. Kergon'" <agk@redhat.com>,
'Mike Snitzer' <msnitzer@redhat.com>,
'Josef Bacik' <jbacik@fb.com>
Cc: dm-devel@redhat.com, 'Eric Wheeler' <bcache@lists.ewheeler.net>,
'Tim Small' <tim@buttersideup.com>,
'Kent Overstreet' <kent.overstreet@gmail.com>,
linux-bcache@vger.kernel.org, dm-crypt@saout.de,
'Neil Brown' <neilb@suse.com>,
linux-raid@vger.kernel.org
Subject: RE: [PATCH] dm-log-writes: fix bug with too large bios
Date: Wed, 1 Jun 2016 04:23:17 -0000 [thread overview]
Message-ID: <07bf01d1bbbd$53991750$facb45f0$@codenest.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1605271047280.2109@file01.intranet.prod.int.rdu2.redhat.com>
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?
James
next prev parent reply other threads:[~2016-06-01 4:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 14:51 [PATCH] dm-log-writes: fix bug with too large bios Mikulas Patocka
2016-05-27 15:36 ` Josef Bacik
2016-06-01 4:23 ` James Johnston [this message]
2016-06-01 14:02 ` Mike Snitzer
2016-06-01 17:32 ` [PATCH] " 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='07bf01d1bbbd$53991750$facb45f0$@codenest.com' \
--to=johnstonj.public@codenest.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=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=msnitzer@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 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).