diff options
author | Michal Feix <michal.feix@firma.seznam.cz> | 2006-07-30 06:03:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:39 -0400 |
commit | f0df33bcab4b687f0f18b9ebd69d374642e46a0e (patch) | |
tree | 808ecf0e290eb67063fd1d42af53ed611b486590 /drivers | |
parent | e4b57e0842621f597d744b193ea325d62724596b (diff) |
[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>
Acked-by: Paul Clements <paul.clements@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/nbd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 31a0b605f261..bdbade9a5cf5 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -341,7 +341,8 @@ static struct request *nbd_read_stat(struct nbd_device *lo) | |||
341 | printk(KERN_ERR "%s: Receive data failed (result %d)\n", | 341 | printk(KERN_ERR "%s: Receive data failed (result %d)\n", |
342 | lo->disk->disk_name, | 342 | lo->disk->disk_name, |
343 | result); | 343 | result); |
344 | goto harderror; | 344 | req->errors++; |
345 | return req; | ||
345 | } | 346 | } |
346 | dprintk(DBG_RX, "%s: request %p: got %d bytes data\n", | 347 | dprintk(DBG_RX, "%s: request %p: got %d bytes data\n", |
347 | lo->disk->disk_name, req, bvec->bv_len); | 348 | lo->disk->disk_name, req, bvec->bv_len); |