提交 f0df33bc 编写于 作者: M Michal Feix 提交者: Linus Torvalds

[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: NMichal Feix <michal@feix.cz>
Acked-by: NPaul Clements <paul.clements@steeleye.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e4b57e08
...@@ -341,7 +341,8 @@ static struct request *nbd_read_stat(struct nbd_device *lo) ...@@ -341,7 +341,8 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
printk(KERN_ERR "%s: Receive data failed (result %d)\n", printk(KERN_ERR "%s: Receive data failed (result %d)\n",
lo->disk->disk_name, lo->disk->disk_name,
result); result);
goto harderror; req->errors++;
return req;
} }
dprintk(DBG_RX, "%s: request %p: got %d bytes data\n", dprintk(DBG_RX, "%s: request %p: got %d bytes data\n",
lo->disk->disk_name, req, bvec->bv_len); lo->disk->disk_name, req, bvec->bv_len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册