Patchwork raw-win32: Fix bdrv_flush return value

login
register
mail settings
Submitter Kevin Wolf
Date Jan. 28, 2011, 3:04 p.m.
Message ID <1296227054-13194-1-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/80852/
State New
Headers show

Comments

Kevin Wolf - Jan. 28, 2011, 3:04 p.m.
Reported-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---

Hi TeLeMan,

this seems to be the bug that was exposed by the recent qcow2 cache changes.
Can you give it a try on a real Windows setup? I have tested it only on Wine so
far.

Kevin


 block/raw-win32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
TeLeMan - Jan. 29, 2011, 1:06 a.m.
Thanks, It works very well on win7 and winxp.
--
SUN OF A BEACH



On Fri, Jan 28, 2011 at 23:04, Kevin Wolf <kwolf@redhat.com> wrote:
> Reported-by: TeLeMan <geleman@gmail.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>
> Hi TeLeMan,
>
> this seems to be the bug that was exposed by the recent qcow2 cache changes.
> Can you give it a try on a real Windows setup? I have tested it only on Wine so
> far.
>
> Kevin
>
>
>  block/raw-win32.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/block/raw-win32.c b/block/raw-win32.c
> index 06c9710..c204a80 100644
> --- a/block/raw-win32.c
> +++ b/block/raw-win32.c
> @@ -153,7 +153,7 @@ static int raw_flush(BlockDriverState *bs)
>     int ret;
>
>     ret = FlushFileBuffers(s->hfile);
> -    if (ret != 0) {
> +    if (ret == 0) {
>         return -EIO;
>     }
>
> --
> 1.7.2.3
>
>

Patch

diff --git a/block/raw-win32.c b/block/raw-win32.c
index 06c9710..c204a80 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -153,7 +153,7 @@  static int raw_flush(BlockDriverState *bs)
     int ret;
 
     ret = FlushFileBuffers(s->hfile);
-    if (ret != 0) {
+    if (ret == 0) {
         return -EIO;
     }