From: Samuel Thibault Subject: [PATCH] minios (blkfront): Add more information on block error Date: Thu, 20 Mar 2014 13:10:22 +0100 Message-ID: <20140320121022.GA17887@type.bordeaux.inria.fr> References: <20140320114544.GA20099@type.bordeaux.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20140320114544.GA20099@type.bordeaux.inria.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel List-Id: xen-devel@lists.xenproject.org This notably prints the offset and size of the block operation in error. Signed-off-by: Samuel Thibault diff --git a/extras/mini-os/blkfront.c b/extras/mini-os/blkfront.c index f4283a9..22578a3 100644 --- a/extras/mini-os/blkfront.c +++ b/extras/mini-os/blkfront.c @@ -507,15 +507,19 @@ moretodo: aiocbp = (void*) (uintptr_t) rsp->id; status = rsp->status; - if (status != BLKIF_RSP_OKAY) - printk("block error %d for op %d\n", status, rsp->operation); - switch (rsp->operation) { case BLKIF_OP_READ: case BLKIF_OP_WRITE: { int j; + if (status != BLKIF_RSP_OKAY) + printk("%s error %d on %s at offset %llu, num bytes %llu\n", + rsp->operation == BLKIF_OP_READ?"read":"write", + status, aiocbp->aio_dev->nodename, + (unsigned long long) aiocbp->aio_offset, + (unsigned long long) aiocbp->aio_nbytes); + for (j = 0; j < aiocbp->n; j++) gnttab_end_access(aiocbp->gref[j]); @@ -523,11 +527,17 @@ moretodo: } case BLKIF_OP_WRITE_BARRIER: + if (status != BLKIF_RSP_OKAY) + printk("write barrier error %d\n", status); + break; case BLKIF_OP_FLUSH_DISKCACHE: + if (status != BLKIF_RSP_OKAY) + printk("flush error %d\n", status); break; default: - printk("unrecognized block operation %d response\n", rsp->operation); + printk("unrecognized block operation %d response (status %d)\n", rsp->operation, status); + break; } dev->ring.rsp_cons = ++cons;