[Pvfs2-developers] Re: Pvfs2-cvs Digest, Vol 8, Issue 9

Sam Lang slang at mcs.anl.gov
Fri Aug 4 11:12:34 EDT 2006


On Aug 3, 2006, at 3:51 PM, Murali Vilayannur wrote:

>
>
> <snipped>
>> +
>> +        /* aio_return gets the return value of the individual op */
>> +        ret = aio_return(&aiocb_p[i]);
>> +
>> +        if(op_p->u.b_rw_list.sigev.sigev_notify == SIGEV_NONE)
>> +        {
>> +            /* aio_return doesn't seem to return bytes read/ 
>> written if
>> +             * sigev_notify == SIGEV_NONE, so we set the out size
>> +             * from what's requested.  For reads we just leave as  
>> zero,
>> +             * which ends up being OK,
>> +             * since the amount read (if past EOF its less than  
>> requested)
>> +             * is determined from the bstream size.
>> +             */
>> +            if (op_p->type == BSTREAM_WRITE_LIST ||
>> +                op_p->type == BSTREAM_WRITE_AT)
>> +            {
>> +                *(op_p->u.b_rw_list.out_size_p) += aiocb_p 
>> [i].aio_nbytes;
>> +            }
>> +        }
>> +        else
>> +        {
>> +            *(op_p->u.b_rw_list.out_size_p) += ret;
>> +        }
>> +
>
> Nice cleanup, Sam!
> Quick question regarding the comment on aio_return() and SIGEV_NONE.
> Are you sure that comment/implementation is correct?
> Isnt this a problem for writes() if the disk/fs is full by returning
> optimistically?
>
> Perhaps aiocb_p[i] was not memset() with 0's prior to lio_listio. See
> attached program which demonstrates errors if the memset() was not  
> done.
> (Run the program with and without the memset at the top of the  
> program and
> you will see interesting errors even though there are none!)
>

I'll have to check if memset works.  That code has been in there for  
a while (it just showed up in this diff because I moved things  
around).  I added specifically to fix an IO bug I was getting when  
AIO_THREADED was disabled.  I'll try and see if everything works with  
memset when I get a chance.

-sam


> Thanks,
> Murali
> <aio_none.c>



More information about the Pvfs2-developers mailing list