Hi,

I am new to Linux Kernel development. So please bare with me for trivial things.
If it is not the right forum to post then please let me know the appropriate 
channel

I am facing issues on Ubuntu 12.04.2 and 12.04.3. For one project I need to 
hook into the make_request function of existing block devices and need to do 
some processing on the read data before passing it onto user mode applications.

My_hooked_in_make_request_fn=>clone the existing bio and change bio_endio 
callback to my own callback fn (hook_bio_endio)=> In hook_bio_endio do some 
processing => call original bio's bi_endio function

Code works perfectly fine with 32-bit and 64-bit versions of 2.6.34 and 3.2 
kernel versions and it also works on 3.6 and 3.8 kernel version but only on 
64-bit.

Investigations revealed that it is happening because in bio_endio callback 
function I get bio->bi_size as non zero value. And it is same size which is 
requested from block device. I was at-least expecting it to be smaller than the 
requested size.

Why I am getting the same size in hook_bio_endio function? Is it due to IO 
splitting/partially completed IO's? How do I handle it?

I have noticed that for smaller request like 4K hook_bio_endio is receiving 
bi_size as 0 and for 128K or little smaller getting same 128K size in bi_size.

Please help me understand why and how it is happening and how to deal with it.

Thanks & Regards,
Intekhab

-- 
You received this message because you are subscribed to the Google Groups 
"linuxkernelnewbies" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to