Skip to content

Commit

Permalink
block, drbd: fix drbd_req_new() initialization
Browse files Browse the repository at this point in the history
mempool_alloc() does not support __GFP_ZERO since elements may come from
memory that has already been released by mempool_free().

Remove __GFP_ZERO from mempool_alloc() in drbd_req_new() and properly
initialize it to 0.

Cc: Lars Ellenberg <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: David Rientjes <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
rientjes authored and axboe committed Mar 25, 2015
1 parent ea7618e commit 23fe8f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ static struct drbd_request *drbd_req_new(struct drbd_device *device,
{
struct drbd_request *req;

req = mempool_alloc(drbd_request_mempool, GFP_NOIO | __GFP_ZERO);
req = mempool_alloc(drbd_request_mempool, GFP_NOIO);
if (!req)
return NULL;
memset(req, 0, sizeof(*req));

drbd_req_make_private_bio(req, bio_src);
req->rq_state = bio_data_dir(bio_src) == WRITE ? RQ_WRITE : 0;
Expand Down

0 comments on commit 23fe8f8

Please sign in to comment.