[Gluster-devel] QEMU-libgfapi integration: glfs_pwritev_async() failing for iovec count>1

Bharata B Rao bharata.rao at gmail.com
Mon Jul 16 04:04:08 UTC 2012


On Sat, Jul 14, 2012 at 11:07 PM, Anand Avati <anand.avati at gmail.com> wrote:
> Thanks for reporting! Let me know if this fixes the problem --
>
> ----------------snip-----------------------
> diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
> index 7523ed2..b62942b 100644
> --- a/api/src/glfs-fops.c
> +++ b/api/src/glfs-fops.c
> @@ -480,6 +480,7 @@ glfs_pwritev (struct glfs_fd *glfd, const struct iovec
> *iovec, int iovcnt,
>         size_t          size = -1;
>         struct iobref  *iobref = NULL;
>         struct iobuf   *iobuf = NULL;
> +       struct iovec    iov = {0, };
>
>         __glfs_entry_fd (glfd);
>
> @@ -510,7 +511,10 @@ glfs_pwritev (struct glfs_fd *glfd, const struct iovec
> *iovec, int iovcnt,
>
>         iov_unload (iobuf_ptr (iobuf), iovec, iovcnt);
>
> -       ret = syncop_writev (subvol, glfd->fd, iovec, iovcnt, offset,
> +       iov.iov_base = iobuf_ptr (iobuf);
> +       iov.iov_len = size;
> +
> +       ret = syncop_writev (subvol, glfd->fd, &iov, 1, offset,
>                              iobref, flags);
>
>         iobuf_unref (iobuf);
> --------------------------------------------------------

Thanks. This fixes the problem.

Regards,
Bharata.




More information about the Gluster-devel mailing list