Skip to content

Commit

Permalink
[PATCH] nbd: Abort request on data reception failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Feix authored and Linus Torvalds committed Jul 31, 2006
1 parent e4b57e0 commit f0df33b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
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);
Expand Down

0 comments on commit f0df33b

Please sign in to comment.