From: Jeff Garzik <jgarzik@pobox.com>
To: Kevin Corry <corry@ecn.purdue.edu>
Cc: Joe Thornber <joe@fib011235813.fsnet.co.uk>,
dm-devel@sistina.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dm.c : Check memory allocations
Date: Fri, 27 Dec 2002 17:00:08 -0500 [thread overview]
Message-ID: <20021227220008.GA11577@gtf.org> (raw)
In-Reply-To: <200212272155.gBRLtWD7013508@shay.ecn.purdue.edu>
On Fri, Dec 27, 2002 at 04:55:31PM -0500, Kevin Corry wrote:
> Check memory allocations when cloning bio's.
>
> --- linux-2.5.53a/drivers/md/dm.c Mon Dec 23 23:21:04 2002
> +++ linux-2.5.53b/drivers/md/dm.c Fri Dec 27 14:50:29 2002
> @@ -394,6 +393,10 @@
> */
> clone = clone_bio(bio, ci->sector, ci->idx,
> bio->bi_vcnt - ci->idx, ci->sector_count);
> + if (!clone) {
> + dec_pending(ci->io, -ENOMEM);
> + return;
> + }
> __map_bio(ti, clone, ci->io);
> ci->sector_count = 0;
>
> @@ -417,6 +420,10 @@
> }
>
> clone = clone_bio(bio, ci->sector, ci->idx, i - ci->idx, len);
> + if (!clone) {
> + dec_pending(ci->io, -ENOMEM);
> + return;
> + }
> __map_bio(ti, clone, ci->io);
>
> ci->sector += len;
This seems a bit insufficient. Why is this error not propagated up
through to __split_bio ?
Jeff
next prev parent reply other threads:[~2002-12-27 21:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-27 21:55 [PATCH] dm.c : Check memory allocations Kevin Corry
2002-12-27 22:00 ` Jeff Garzik [this message]
2002-12-27 22:16 ` Kevin Corry
2002-12-30 10:51 ` Joe Thornber
2002-12-31 16:22 ` Kevin Corry
2003-01-02 9:55 ` Joe Thornber
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=20021227220008.GA11577@gtf.org \
--to=jgarzik@pobox.com \
--cc=corry@ecn.purdue.edu \
--cc=dm-devel@sistina.com \
--cc=joe@fib011235813.fsnet.co.uk \
--cc=linux-kernel@vger.kernel.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