Re: About bio_endio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Alvin,

On Mon, Jun 23, 2014 at 10:39 PM, Alvin Abitria <abitria.alvin@xxxxxxxxx> wrote:
> Hello,
>
> I'm developing a block driver using the make_request method, effectively
> bypassing existing scsi or request stack in block layer.  So that means im
> directly working with bios.  As prescribed in linux documentation and from
> referring to similar drivers in kernel, you close a session with a bio with
> the bio_endio function.

So it means you are just passing on the bios without the request
structure if I'm correct?
I don't know how you are handling blk_finish_plug without having
request or request queue,
I maybe wrong in understanding how you are handling it.

>
> I usually invoke bio_endio during successful I/O completion, meaning with an
> error code of zero.  But there are cases that this is not fulfilled or there
> are error cases.  My question is, what are the valid error codes that can be
> used with it?  My initial impression is that other than zero as error code,
-EIO is the one that you should use I think,
> bio_endio will fail.  I've read somewhere that -EBUSY is not recognized, and
> I tried -EIO but my driver crashed.  I got a panic in some dio_xxx function
> leading from bio_endio(bio,-EIO). I would like to block subsequent bios sent

If it's okay for you to post the error then can you do that? I was
seeing the code for
dio_end_io but it would be good if you can post the exact crash
backtrace if you've got that.

> to me after reaching my queue depth and with no tags left, and so I want to
> use bio_endio with an error code.

If you have a request queue then you could call blk_stop_queue and
blk_start_queue but I don't know if this is
relevant to your case.

>
> What are those error codes, and will they work for my intended function?
> Thanks!

-EIO should work, but first let's find out why you got the crash.

>
>
>
> Sent from Samsung Mobile
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
        ---P.K.S

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux