[Pvfs2-developers] Re: Pvfs2-cvs Digest, Vol 8, Issue 9
Murali Vilayannur
vilayann at mcs.anl.gov
Thu Aug 3 16:51:45 EDT 2006
<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!)
Thanks,
Murali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aio_none.c
Type: text/x-csrc
Size: 1944 bytes
Desc:
Url : http://www.beowulf-underground.org/pipermail/pvfs2-developers/attachments/20060803/a593a5c8/aio_none.bin
More information about the Pvfs2-developers
mailing list