[dm-devel] Re: [PATCH 12/17] bottom-layer barrier support

Mikulas Patocka mpatocka at redhat.com
Mon Apr 27 23:32:00 UTC 2009



On Tue, 28 Apr 2009, Alasdair G Kergon wrote:

> On Mon, Apr 27, 2009 at 07:09:32PM -0400, Mikulas Patocka wrote:
> > The code is correct as it is.
>  
> I don't see that.
> 
> > The difference is the zero-barrier flush request --- it should have 
> > bi_sector always 0.
> 
> But I'm asking at what point that is defined?

It is not defined, the Linux way is that there is no specification and the 
code is considered the specification.

The point is that any code in the Linux kernel that creates zero-length 
barrier creates it with sector number 0. So I'm doing it the same way. I 
have no capability to review all the drivers if they accept zero-barriers 
with non-zero sector number or not. So I set it to zero.

> 0 before calling the target's map function?
> In which case it is wrong to perform:
> 	bio->bi_sector = dc->start_write + (bio->bi_sector - ti->begin);
> 
> Or if it's not set to zero until the
> 	bio->bi_sector = 0 
> line, then what does it hold on entry to the function and what does that
> mean?

On entry to the function it holds zero if it is processing zero-length 
barrier. The line "bio->bi_sector = dc->start_write + (bio->bi_sector - 
ti->begin)" can set it to non-zero, so I set it to zero again. If you 
want, you can somehow rearrange the code so that "bio->bi_sector = 
dc->start_write + (bio->bi_sector - ti->begin)" is performed only if the 
request has non-zero length.

Mikulas

> Alasdair
> -- 
> agk at redhat.com
> 




More information about the dm-devel mailing list