On 23/05/13 23:09, Joe Lawrence wrote: > Hi Jens, > > Subject: [PATCH v4] block: handle pointer error from blk_get_request > > The blk_get_request function may fail in low-memory conditions or during > device removal (even if __GFP_WAIT is set). To distinguish between these > errors, modify the blk_get_request call stack to return the appropriate > error pointer. Verify that all callers check the return status and > consider IS_ERR instead of a simple NULL pointer check. > > Signed-off-by: Joe Lawrence <joe.lawrence@xxxxxxxxxxx> > Cc: Jens Axboe <axboe@xxxxxxxxx> > Cc: "James E.J. Bottomley" <JBottomley@xxxxxxxxxxxxx> > Cc: Bart Van Assche <bvanassche@xxxxxxx> > Cc: linux-scsi@xxxxxxxxxxxxxxx ACK-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx> > --- <> > drivers/scsi/osd/osd_initiator.c | 4 ++-- <> > diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c > index d8293f2..b4cd56b 100644 > --- a/drivers/scsi/osd/osd_initiator.c > +++ b/drivers/scsi/osd/osd_initiator.c > @@ -1567,8 +1567,8 @@ static struct request *_make_request(struct request_queue *q, bool has_write, > struct request *req; > > req = blk_get_request(q, has_write ? WRITE : READ, flags); > - if (unlikely(!req)) > - return ERR_PTR(-ENOMEM); > + if (unlikely(IS_ERR(req))) > + return req; > > return req; > } -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html