On Tue, 28 Apr 2009, Alasdair G Kergon wrote: > On Mon, Apr 27, 2009 at 07:32:00PM -0400, Mikulas Patocka wrote: > > On entry to the function it holds zero if it is processing zero-length > > barrier. > > OK - so that is a clear definition the writer of a target map function can > rely upon, good. > > > 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. > > Please do that. In dm I try to enforce a rule that the values of variables > always correspond to their definitions - if a calculation needs intermediate > steps then different and meaningful intermediate variables are used > instead. Here, bi_sector seems to be set to a meaningless intermediate > value which is a recipe for confusion. OK. Mikulas > Alasdair > -- > agk@xxxxxxxxxx > -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel