[PATCHv2] NVMe: Sync reset and scan work

Keith Busch keith.busch at intel.com
Tue May 24 14:39:54 PDT 2016


On Tue, May 24, 2016 at 05:59:38PM +0200, Johannes Thumshirn wrote:
> On Tue, May 24, 2016 at 09:06:10AM -0600, Keith Busch wrote:
> >  
> > +static int nvme_reset_ctrl(struct nvme_ctrl *ctrl)
> > +{
> > +	if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_SCHED_RESET))
> > +		return -EPERM;
> 
> Is there a specific reason why you're using EPERM instead of EINVAL? I always
> understood EPERM as a privilege level error code, while EINVAL would be a more
> appropriate error code for an illegal state transition, IMHO.

The EPERM description sounded about right: "Operation not permitted". The
user just attempted a reset at an impermissable time, but didn't give any
illegal arguments. The exact same action could very well be successful
a moment later. Maybe EBUSY or EAGAIN?



More information about the Linux-nvme mailing list