Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [patch] __bio_clone() behaviour
Date: Thu, 27 Jan 2005 09:56:16 +0100	[thread overview]
Message-ID: <200501270956.16709.philipp.reisner@linbit.com> (raw)
In-Reply-To: <20050126164612.GH5511@marowsky-bree.de>

Am Mittwoch, 26. Januar 2005 17:46 schrieb Lars Marowsky-Bree:
> With the __bio_clone() bugfix by Jens Axboe (in the recent 2.6.10-ac
> kernels or SLES9 SP1) which causes __bio_clone() to copy the bi_io_vec,
> it would always try to copy the _maximum_ size, as defined by
> bio_src->bi_max_vecs:
>
> inline void __bio_clone(struct bio *bio, struct bio *bio_src)
> {
>         request_queue_t *q = bdev_get_queue(bio_src->bi_bdev);
>         memcpy(bio->bi_io_vec, bio_src->bi_io_vec, bio_src->bi_max_vecs *
> sizeof(struct bio_vec)); ...
>
> drbd however only has space for a single iovec (because it's all
> statically allocated right now), and so the memcpy would silently
> overwrite memory.
>
> The attached patch 'fixes' this up.
>
> Note that it is a bit ugly but safe, as drbd already asserts that
> bi_vcnt == 1 anyway.
>
> FWIW, drbd seems to be the only user of __bio_clone() I could find,
> there's no in-tree users, everything goes through bio_clone() otherwise,
> which would have dynamically allocated the properly sized structures.
>

This really gives me the feeling that I should not have done the 
0.7.9 release. --- The only one to blame is myself, who thought it 
would be a nice idea to have the same release as SUSE.
Bullshit -> The next release will only happen when I am convinced
that the new release is necessary, and that it will not be a 
disaster.


BTW, regarind this patch: We now modify someone else's BIO. 
     Is this a good idea ?

-Philipp
-- 
: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria    http://www.linbit.com :

  reply	other threads:[~2005-01-27  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26 16:46 [Drbd-dev] [patch] __bio_clone() behaviour Lars Marowsky-Bree
2005-01-27  8:56 ` Philipp Reisner [this message]
2005-01-27  9:16   ` Lars Marowsky-Bree

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=200501270956.16709.philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=drbd-dev@lists.linbit.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