On Tue, 3 Jun 2014 15:45:36 -0400 Jeff Moyer <[email protected]> wrote:
> Joe Lawrence <[email protected]> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

