WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [TAPDISK] Fix qcow initialization bug.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [TAPDISK] Fix qcow initialization bug.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Apr 2007 09:50:07 -0700
Delivery-date: Wed, 11 Apr 2007 09:49:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jake Wires <jwires@xxxxxxxxxxxxx>
# Date 1176230443 25200
# Node ID 380db34694d7ceb80a4e8f21211c2e10047d92e5
# Parent  4dc14c591e6cf5177974f244db9ae4f609521417
[TAPDISK] Fix qcow initialization bug.

fd_end was being incorrectly initialized upon open, leading to data corruption.

Signed-off-by: Jake Wires <jwires@xxxxxxxxxxxxx>
---
 tools/blktap/drivers/block-qcow.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff -r 4dc14c591e6c -r 380db34694d7 tools/blktap/drivers/block-qcow.c
--- a/tools/blktap/drivers/block-qcow.c Tue Apr 10 18:49:20 2007 +0100
+++ b/tools/blktap/drivers/block-qcow.c Tue Apr 10 11:40:43 2007 -0700
@@ -949,8 +949,14 @@ int tdqcow_open (struct disk_driver *dd,
                goto fail;
        }
        init_fds(dd);
-       s->fd_end = (final_cluster == 0 ? (s->l1_table_offset + l1_table_size) 
: 
-                               (final_cluster + s->cluster_size));
+
+       if (!final_cluster)
+               s->fd_end = s->l1_table_offset + l1_table_size;
+       else {
+               s->fd_end = lseek64(fd, 0, SEEK_END);
+               if (s->fd_end == (off64_t)-1)
+                       goto fail;
+       }
 
        return 0;
        

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [TAPDISK] Fix qcow initialization bug., Xen patchbot-unstable <=