Re: Questions answered by Neil Brown
From: Peter T. Breuer <hidden>
Date: 2003-02-25 09:11:52
"A month of sundays ago Neil Brown wrote:"
On Monday February 24, Paul.Clements@SteelEye.com wrote:quoted
So I think this means that we really need to duplicate the buffer memory (bh->b_page, bh->b_data) and point the mirror I/Os to the duplicated buffer, so we can allow the original (master_bh) to be freed before all the I/Os complete. We then free the duplicate when the last mirror I/O completes, right?Yes, that is right.
It's early in the morning (for me!), but I believe that page data at least can be encouraged to stay around by hiking a reference counter or equivalent. It really depends how that b_end_io() got hold of its buffer and what it does with it on completion. The end_buffer_io() fn in buffer.c will lock the page and walk through the bh chain hanging off bh->b_this_page (->b_this_page ...) to see if those other bh's have completed before marking the page up to date and unlocking it. So it might be enough to chain all the mirror bh's through bh->b_this_page. I believe that currently this field is just set to "1" in raid1_make_request(). Peter