[Drbd-dev] Re: [DRBD-cvs] r1743 - in branches/drbd-0.7: . drbd

Lars Marowsky-Bree lmb at suse.de
Wed Feb 2 11:13:22 CET 2005


On 2005-02-01T18:36:43, Philipp Reisner <philipp.reisner at linbit.com> wrote:

> I did not look at the comments, I read the code. And what I read there was:
> a BIO has after bio_init() a refcount (bi_cnt) of 1. It is freed when the 
> refcount drops to zero. 
> 
> bio_alloc();
> do something with it

"submit_bio()" is slightly different from just "something".

> bio_put();
> 
> is right.
> 
> What you did is:
> 
> bio_alloc();
> bio_get();   // increase to 2
> bio_put();   // decreat to 1
> 
> and let it live forever...

The cleanup at the end of the bio processing however should drop the bio
reference count too. Which is why the comment in bio.h says what it is.
Either the comment is wrong (and Jens's very same fix for the md code,
too), or you have introduced a race condition into the actlog.


Sincerely,
    Lars Marowsky-Brée <lmb at suse.de>

-- 
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business



More information about the drbd-dev mailing list