file-posix: Fix fd_open check in raw_co_copy_range_to
authorFam Zheng <famz@redhat.com>
Mon, 2 Jul 2018 02:58:34 +0000 (10:58 +0800)
committerMax Reitz <mreitz@redhat.com>
Mon, 9 Jul 2018 17:43:24 +0000 (19:43 +0200)
One of them is a typo. But update both to be more readable.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 20180702025836.20957-3-famz@redhat.com
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/file-posix.c

index 98987b80f16381dbf74608f38d75959aa9b9ae1c..349f77a3afc341e36e4b850704fe9f88fd558f79 100644 (file)
@@ -2611,7 +2611,7 @@ static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs,
     }
 
     src_s = src->bs->opaque;
-    if (fd_open(bs) < 0 || fd_open(bs) < 0) {
+    if (fd_open(src->bs) < 0 || fd_open(dst->bs) < 0) {
         return -EIO;
     }
     return paio_submit_co_full(bs, src_s->fd, src_offset, s->fd, dst_offset,