Messages in this thread | | | Date | Tue, 3 Jun 2014 16:21:00 -0400 | From | Joe Lawrence <> | Subject | Re: [PATCH 2/2] block,scsi: convert and handle ERR_PTR from blk_get_request |
| |
On Tue, 3 Jun 2014 15:45:36 -0400 Jeff Moyer <jmoyer@redhat.com> wrote:
> Joe Lawrence <joe.lawrence@stratus.com> writes: > > > 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 > > ERR_PTR. Verify that all callers check the return status and consider > > IS_ERR instead of a simple NULL pointer check. > > I'm curious to know what testing you did, and what code paths do > anything different for ENOMEM vs EIO. I guess ENOMEM may make it all > the way back to userspace?
Hi Jeff,
Good question. In the case of the short repro program provided by Paolo in [1], the ioctl call returned error and set -ENODEV.
As for each individual caller of blk_get_request, I did not audit all code paths back out to user space. I can take a look, but I'm guessing that 24-ish callers might make for quite a *few* scenarios to verify.
Conversion to ERR_PTR was suggested by Jens as a complete fix, but without sufficient Ack's, I can understand holding off on this part of the set.
-- Joe
[1] http://thread.gmane.org/gmane.linux.scsi/85824
| |