Patchwork raw-win32.c: Fix incorrect handling behaviour of small block files

login
register
mail settings
Submitter Tal Kain
Date Sept. 9, 2013, 9:14 a.m.
Message ID <1378718095-18850-1-git-send-email-tal.kain@ravellosystems.com>
Download mbox | patch
Permalink /patch/273596/
State New
Headers show

Comments

Tal Kain - Sept. 9, 2013, 9:14 a.m.
It is a valid case that the read data's size is smaller than the
requested size since there could be files that are smaller than
the minimum block size (For ex. when a VMDK disk descriptor file)

Signed-off-by: Tal Kain <tal.kain@ravellosystems.com>
---
 block/raw-win32.c |    1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/block/raw-win32.c b/block/raw-win32.c
index 9b5b2af..bffbee8 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -85,6 +85,7 @@  static size_t handle_aiocb_rw(RawWin32AIOData *aiocb)
             ret_count = 0;
         }
         if (ret_count != len) {
+            offset += ret_count;
             break;
         }
         offset += len;