xen_disk: move sanity check to the correct place
PATCH 1/1 xen_disk: move sanity check to the correct place
Hi,
The sanity check which refuses write access to disks configured read-only is at the wrong place. This patch fixes it.
please apply,
Gerd
Quoted 1 line
From
d4a9e1a335efd0e2e753e1752570b0dd527a12bcMon Sep 17 00:00:00 2001
From: Gerd Hoffmann <[email protected]>
Date: Wed, 22 Apr 2009 12:53:01 +0200
Subject: [PATCH 01/21] xen_disk: move sanity check to the correct place
--- hw/xen_disk.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
hw/xen_disk.c +5 -4
@@ -179,10 +179,6 @@ static int ioreq_parse(struct ioreq *ioreq)switch (ioreq->req.operation) {case BLKIF_OP_READ : ioreq->prot =PROT_WRITE ;/* to memory */ -if (ioreq->req.operation !=BLKIF_OP_READ && blkdev->mode[0 ] !='w' ) { -xen_be_printf (&blkdev->xendev,0 ,"error: write req for ro device\n" ); - goto err; - }break ;case BLKIF_OP_WRITE_BARRIER :if (!syncwrite)
@@ -199,6 +195,11 @@ static int ioreq_parse(struct ioreq *ioreq) goto err; }; +if (ioreq->req.operation !=BLKIF_OP_READ && blkdev->mode[0 ] !='w' ) { +xen_be_printf (&blkdev->xendev,0 ,"error: write req for ro device\n" ); + goto err; + } + ioreq->start = ioreq->req.sector_number * blkdev->file_blk;for (i =0 ; i < ioreq->req.nr_segments; i++) {if (i ==BLKIF_MAX_SEGMENTS_PER_REQUEST ) {
Signature · 1 line
1.6.2.2
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel