lkml.org 
[lkml]   [2006]   [Jul]   [16]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 16 Jul 2006 15:17:12 +0200
FromMichal Feix <>
Subject[PATCH] nbd: Abort request on data reception failure
When reading from nbd device, we need to receive all the data after
receiving reply packet from the server - otherwise such request will
never be ended.

If socket is closed right after accepting reply control packet and in
the middle of waiting for read data, nbd_read_stat() returns NULL and
nbd_end_request() is not called.

This patch fixes it.

Signed-off-by: Michal Feix <michal@feix.cz>
---
diff -upr 2.6.18-rc2.orig/drivers/block/nbd.c 2.6.18-rc2/drivers/block/nbd.c
--- 2.6.18-rc2.orig/drivers/block/nbd.c	2006-07-16 15:08:07.866293000 +0200
+++ 2.6.18-rc2/drivers/block/nbd.c	2006-07-16 15:08:55.361261250 +0200
@@ -339,7 +339,8 @@ static struct request *nbd_read_stat(str
 					printk(KERN_ERR "%s: Receive data failed (result %d)\n",
 							lo->disk->disk_name,
 							result);
-					goto harderror;
+					req->errors++;
+					return req;
 				}
 				dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
 					lo->disk->disk_name, req, bvec->bv_len);
\
 
 \ /
  Last update: 2006-07-16 13:19    [from the cache]
©2003-2008