Re: What am I doing wrong? submit_bio() suddenly stops working...

From: Ted Ts'o
Date: Sat Oct 23 2010 - 10:48:47 EST


On Fri, Oct 22, 2010 at 09:19:37AM +0200, Jens Axboe wrote:
>
> In my experience, use-after-free bugs are best caught using the
> allocator poisoning along with lock checking. I guess that didn't
> trigger for you?

No, I tried adding slab_debug=FP, but the structure got reused too
quickly. And I've always had lock checking enabled.

> Out of curiousity, what was the exact bug?

To be honest, I don't know why it was causing the problem. I had a

if (test_bit(BIO_UPTODATE, &bio->bi_flags))
error = 0;

After the bio_put, which was clearly wrong, so I fixed it. But
test_bit is a read-only instruction, and if error should have been
zero since I'm testing using kvm and there haven't been any errors.
(I need to test to make sure my error handling paths work correctly;
later).

But it's now working, and at this point, given that I have something
that works, although I'm curious what was causing the mysterious
failures, I may be willing to just let it be a mystery...

- Ted
--
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/