Skip to contentSkip to conversation

minios (blkfront): Drop unused total_bytes field

PATCH In review Samuel Thibault 2 participants 8 messages Mar 20, 2014 – Mar 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios (blkfront): Drop unused total_bytes field

The total_bytes field of blkfront_aiocb is never used.

extras/mini-os/include/blkfront.h +0 -1
index 3528af9..9bcf93f 100644
@@ -8,7 +8,6 @@ struct blkfront_aiocb
     uint8_t *aio_buf;
     size_t aio_nbytes;
     off_t aio_offset;
-    size_t total_bytes;
     uint8_t is_write;
     void *data;
#1 lore raw

PATCH 1/1 minios (blkfront): Add more information on block error

This notably prints the offset and size of the block operation in error.

extras/mini-os/blkfront.c +14 -4
index f4283a9..22578a3 100644
@@ -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;
#2 lore raw

Re: [PATCH] minios (blkfront): Add more information on block error

Quoted 3 lines · Samuel Thibault

This notably prints the offset and size of the block operation in error.

Acked + applied, thanks.

#3 lore raw
In reply to Samuel Thibault
Quoted 1 line · Samuel Thibault

The total_bytes field of blkfront_aiocb is never used.

Are you sure?:

/local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c: In function ‘vbd_do_aio’:
/local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c:154:11: error: ‘struct blkfront_aiocb’ has no member named ‘total_bytes’ /local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c:155:15: error: ‘struct blkfront_aiocb’ has no member named ‘total_bytes’ /local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c:158:36: error: ‘struct blkfront_aiocb’ has no member named ‘total_bytes’ /local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c:158:142: error: ‘struct blkfront_aiocb’ has no member named ‘total_bytes’ /local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c: In function ‘vbd_aio_setup’:
/local/scratch/ianc/devel/committer.git/stubdom/ioemu/block-vbd.c:232:15: error: ‘struct blkfront_aiocb’ has no member named ‘total_bytes’ make[3]: *** [block-vbd.o] Error 1
make[3]: *** Waiting for unfinished jobs....

Quoted 16 lines
extras/mini-os/include/blkfront.h +0 -1
index 3528af9..9bcf93f 100644
@@ -8,7 +8,6 @@ struct blkfront_aiocb
     uint8_t *aio_buf;
     size_t aio_nbytes;
     off_t aio_offset;
-    size_t total_bytes;
     uint8_t is_write;
     void *data;
 
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 4 lines · Ian Campbell, le Fri 21 Mar 2014 11:49:08 +0000, a écrit :
Quoted 1 line · Samuel Thibault

The total_bytes field of blkfront_aiocb is never used.

Are you sure?:

Oh, right, I didn't remember to check that part, sorry.

Samuel

#5 lore raw
Quoted 7 lines · Samuel Thibault
Quoted 4 lines · Ian Campbell, le Fri 21 Mar 2014 11:49:08 +0000, a écrit :
Quoted 1 line · Samuel Thibault

The total_bytes field of blkfront_aiocb is never used.

Are you sure?:

Oh, right, I didn't remember to check that part, sorry.

I guess this means the patch is to be dropped, rather than there being a follow up with thes references removed?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 11 lines · Ian Campbell, le Fri 21 Mar 2014 12:41:15 +0000, a écrit :
Quoted 7 lines · Samuel Thibault
Quoted 4 lines · Ian Campbell, le Fri 21 Mar 2014 11:49:08 +0000, a écrit :
Quoted 1 line · Samuel Thibault

The total_bytes field of blkfront_aiocb is never used.

Are you sure?:

Oh, right, I didn't remember to check that part, sorry.

I guess this means the patch is to be dropped, rather than there being a follow up with thes references removed?

Yes, the field is indeed used by ioemu for read/writes which can't be performed in just one go.

Samuel

#7 lore raw
Quoted 8 lines · Samuel Thibault
Quoted 7 lines · Ian Campbell, le Fri 21 Mar 2014 12:41:15 +0000, a écrit :
Quoted 6 lines · Samuel Thibault
Quoted 4 lines · Ian Campbell, le Fri 21 Mar 2014 11:49:08 +0000, a écrit :
Quoted 1 line · Samuel Thibault

The total_bytes field of blkfront_aiocb is never used.

Are you sure?:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Oh, right, I didn't remember to check that part, sorry.

I guess this means the patch is to be dropped, rather than there being a follow up with thes references removed?

Yes, the field is indeed used by ioemu for read/writes which can't be performed in just one go.

Thanks. Dropped from my queue.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel