Re: [PATCH 13/17] nvme: allow user passthrough commands to poll

Keith Busch
2022-03-08T17:20:55Z

On Tue, Mar 08, 2022 at 08:51:01PM +0530, Kanchan Joshi wrote:
> if (copy_from_user(&io, uio, sizeof(io)))
> return -EFAULT;
> - if (io.flags)
> - return -EINVAL;
> + if (io.flags & NVME_HIPRI)
> + rq_flags |= REQ_POLLED;

I'm pretty sure we can repurpose this previously reserved field for this
kind of special handling without an issue now, but we should continue
returning EINVAL if any unknown flags are set. I have no idea what, if
any, new flags may be defined later, so we shouldn't let a future
application think an older driver honored something we are not handling.