aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/nbd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index d7a421579908..dc88bcf320e8 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -231,14 +231,12 @@ error_out:
231 return 1; 231 return 1;
232} 232}
233 233
234static struct request *nbd_find_request(struct nbd_device *lo, char *handle) 234static struct request *nbd_find_request(struct nbd_device *lo,
235 struct request *xreq)
235{ 236{
236 struct request *req, *tmp; 237 struct request *req, *tmp;
237 struct request *xreq;
238 int err; 238 int err;
239 239
240 memcpy(&xreq, handle, sizeof(xreq));
241
242 err = wait_event_interruptible(lo->active_wq, lo->active_req != xreq); 240 err = wait_event_interruptible(lo->active_wq, lo->active_req != xreq);
243 if (unlikely(err)) 241 if (unlikely(err))
244 goto out; 242 goto out;
@@ -293,7 +291,7 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
293 goto harderror; 291 goto harderror;
294 } 292 }
295 293
296 req = nbd_find_request(lo, reply.handle); 294 req = nbd_find_request(lo, *(struct request **)reply.handle);
297 if (unlikely(IS_ERR(req))) { 295 if (unlikely(IS_ERR(req))) {
298 result = PTR_ERR(req); 296 result = PTR_ERR(req);
299 if (result != -ENOENT) 297 if (result != -ENOENT)