List Info

Thread: Fixes for clone_bio and __clone_and_map functions in dm.c




Fixes for clone_bio and __clone_and_map functions in dm.c
user name
2006-03-19 18:24:00
Hi Alasdair and others,

I found a small bug in the clone_bio() function in dm.c . The number of bio
vectors in the cloned bio is incorrectly set to the index of the last bio
vector in its range. I have corrected it in the attached patch.

I encountered another problem in the final else condition of __clone_and_map()
function where the bio vector is split in to two parts. This is perhaps based
on the assumption that the next target can completely accomodate the bio
vector. However, I have encountered situations when this assumption can be
violated and have introduced a do-while loop to correct it.

Please review the attached patch and let me know if you need more information.

Thanks

Abhishek Gupta
2nd Year Graduate Student
Department of Computer Science, UBC.
Vancouver, Canada.


Fixes for clone_bio and __clone_and_map functions in dm.c
user name
2006-03-19 18:38:37
AG> I encountered another problem in the final else
condition of
AG> __clone_and_map() function where the bio vector is
split in to two
AG> parts. This is perhaps based on the assumption that
the next
AG> target can completely accomodate the bio vector.
However, I have
AG> encountered situations when this assumption can be
violated and
AG> have introduced a do-while loop to correct it.

I found this bug last week as it was preventing me from
having targets
that have a split_io of 1 sector.  Interestingly, I had
planned to
code up a solution very similar to yours next week!

I'll test it tomorrow to see if it solves my problem...
Thanks! 

-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danmsus.ibm.com
--
dm-devel mailing list
dm-develredhat.com
http
s://www.redhat.com/mailman/listinfo/dm-devel
Fixes for clone_bio and __clone_and_map functions in dm.c
user name
2006-03-20 00:04:41
On Sun, Mar 19, 2006 at 10:24:00AM -0800, Abhishek Gupta
wrote:
> I found a small bug in the clone_bio() function in dm.c
. The number of bio
> vectors in the cloned bio is incorrectly set to the
index of the last bio
> vector in its range. I have corrected it in the
attached patch.

I don't see that yet - the code is not very transparent
though.
(Look at the places that call the function.)
 
> I encountered another problem in the final else
condition of
> __clone_and_map()
> function where the bio vector is split in to two parts.


Yes, that looks wrong, as Dan reported on IRC this week.
The patch needs a little tidying up though.
[only one split_bvec() call not two?
 reconsider loop entry/exit to avoid artificial-looking
exit?]

Alasdair
-- 
agkredhat.com

--
dm-devel mailing list
dm-develredhat.com
http
s://www.redhat.com/mailman/listinfo/dm-devel
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )