[PATCHv2] NVMe: Sync reset and scan work
Johannes Thumshirn
jthumshirn at suse.de
Tue May 24 08:59:38 PDT 2016
On Tue, May 24, 2016 at 09:06:10AM -0600, Keith Busch wrote:
> This adds a new state for scheduling a reset and synchronizes that state
> with active scanning work. This is so a user can't interrupt namespace
> discovery, which can cause identification to fail.
>
> Reported-by: Ming Lin <mlin at kernel.org>
> Signed-off-by: Keith Busch <keith.busch at intel.com>
> ---
> v1 -> v2:
> added appropriate state transition from the new schedule reset state.
>
[...]
>
> +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.
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn at suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
More information about the Linux-nvme
mailing list