Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCHv2] NVMe: Sync reset and scan work
Date: Tue, 24 May 2016 17:39:54 -0400	[thread overview]
Message-ID: <20160524213954.GD24347@localhost.localdomain> (raw)
In-Reply-To: <20160524155938.wzzsmje6bhlkghwk@c203.arch.suse.de>

On Tue, May 24, 2016@05:59:38PM +0200, Johannes Thumshirn wrote:
> On Tue, May 24, 2016@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?

  reply	other threads:[~2016-05-24 21:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 15:06 [PATCHv2] NVMe: Sync reset and scan work Keith Busch
2016-05-24 15:59 ` Johannes Thumshirn
2016-05-24 21:39   ` Keith Busch [this message]
2016-05-25  8:15     ` Christoph Hellwig
2016-05-27  7:34 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160524213954.GD24347@localhost.localdomain \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox