Re: dirty md raid5 slab bio leak

From: Neil Brown
Date: Mon Jun 27 2005 - 23:16:51 EST


On Tuesday June 28, neilb@xxxxxxxxxxxxxxx wrote:
>
> I just checked my test machine (running 2.6.12-rc3-mm3) and it had a
> really large number of bio and biovec-1 in use too (and it's been
> sitting fairly idle for several days).
>
> I've quickly reviewed the raid1 code and I cannot see a bio leak
> (though that doesn't mean there isn't one..)
>
> If anyone else has a large 'bio' slab, please report the configuration
> (kernel, is md in use, etc).

It's OK, I found it. The bio leaks when writing the md superblock.

Thanks,
NeilBrown


--
insert a missing bio_put when writting the md superblock.

Without this we have a steady growth in the "bio" slab.

Signed-off-by: Neil Brown <neilb@xxxxxxxxxxxxxxx>

### Diffstat output
./drivers/md/md.c | 1 +
1 files changed, 1 insertion(+)

diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~ 2005-06-22 13:16:28.000000000 +1000
+++ ./drivers/md/md.c 2005-06-28 13:02:04.000000000 +1000
@@ -338,6 +338,7 @@ static int super_written(struct bio *bio

if (atomic_dec_and_test(&rdev->mddev->pending_writes))
wake_up(&rdev->mddev->sb_wait);
+ bio_put(bio);
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/