Re: Error handling in fio_libaio_event()

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

 



Hi Sitsofe, Andrey and fio mailing list,

Thanks again for your past help!

I am running into a new problem when I check for write errors after calling io_getevents() that I am hoping you can help me out with.

Comparing it to your function fio_libaio_event() in engines/libaio.c, I am finding that  (ev->res != io_u->xfer_buflen) and that (ev->res > io_u->xfer_buflen).   The value of ev->res, which I believe is the result of the write, is equal to the value of the count parameter passed to io_prep_pwrite(), so it seems like the write succeeded.  

So I was surprised to find the io_u->xfer_buflen value (or in my case, the struct iocb.u.c.nbytes value) less than what it was set to in io_prep_pwrite().  Do you know what might be causing this?

Thanks,
Scott



On 4/3/17, 11:17 PM, "Sitsofe Wheeler" <sitsofe@xxxxxxxxx> wrote:

    Hi Scott,
    
    You might find https://www.fsl.cs.sunysb.edu/~vass/linux-aio.txt useful...
    
    On 4 April 2017 at 01:48, Scott Forman (scforman) <scforman@xxxxxxxxx> wrote:
    >
    > In looking further at fio_libaio_event(), I am wondering if it is possible to get the errno value if one of the events have an error (i.e. if ev->res != io_u->xfer_buflen).
    
    Note this handles one type of error - the case where the I/O was
    accepted at submission time but for some reason when it completed it
    was short or too long(?). As alluded to, errors can also be returned
    at submission time. It's also sensible to check that io_getevents
    hasn't errored too.
    
    > I see that io_u->error is set to –ev->res if ev->res is greater than io_u->xfer_buflen.  But since my io_u->xfer_buflen is a large value, I am guessing that this is not the errno value that caused the error.  Is that true?
    
    This isn't a true errno but rather is a synthesized fio error - I
    guess this is fio checking that it hasn't asked to store more than it
    allocated space for and trying to indicate that it's an error if this
    were to happen.
    
    > Also, if ev->res is less than io_u->xfer_buflen, then io_u->resid is set to (io_u->xfer_buflen - ev->res).  Does that mean that there will be another attempt to write out the io_u->resid bytes?
    
    Not necessarily. For example what happens if you perform a write that
    goes past the end of the file - would you want to retry that even
    though it returned back as being short? Is the fact it came back short
    a definite error?
    
    -- 
    Sitsofe | http://sucs.org/~sits/
    

��.n��������+%������w��{.n�������^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux