Linux block layer
 help / color / mirror / Atom feed
From: Scott Bauer <scott.bauer@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, jonathan.derrick@intel.com,
	david.fugate@intel.com, hch@infradead.org,
	rafael.antognolli@intel.com
Subject: Re: [PATCH] block: sed-opal: Set MBRDone on S3 resume path if TPER is MBREnabled
Date: Thu, 31 Aug 2017 14:13:21 -0600	[thread overview]
Message-ID: <20170831201320.rd4agb7jxae7xh6e@sbauer-Z170X-UD5> (raw)
In-Reply-To: <20170831201942.GA18975@kernel.dk>

On Thu, Aug 31, 2017 at 02:19:44PM -0600, Jens Axboe wrote:
> On Thu, Aug 31 2017, Scott Bauer wrote:
> > @@ -2345,6 +2371,11 @@ bool opal_unlock_from_suspend(struct opal_dev *dev)
> >  				 suspend->unlk.session.sum);
> >  			was_failure = true;
> >  		}
> > +		if (dev->mbr_enabled) {
> > +			ret = __opal_set_mbr_done(dev, &suspend->unlk.session.opal_key);
> > +			if (ret)
> > +				pr_debug("Failed to set MBR Done in S3 resume\n");
> > +		}
> 
> Should ret != 0 set was_failure = true here?

I thought about that too and decided against it. The reasoning is was_failure was supposed
to designate an unlock failure, specifically on the unlock comamnd, not the new mbr_enable
command. An unlock can still succeed and the MBR set can fail under some extreme
scenario, in which case the pr_debug will let us know (maybe we should promote that to pr_warn?).

More over, it seems like none of the callers scsi/nvme are even using the return value. Since
not being able to unlock a range isn't a failure of the actual bring up of the drive everyone
ignores It, I guess. Since no one is using the return value "was_failure" perhaps I should just
refactor this to void. That is unless others think it should stay for potential future devices which
may care if something isn't unlocked and want to do something else?


> 
> -- 
> Jens Axboe
> 

      reply	other threads:[~2017-08-31 20:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 17:42 [PATCH] block: sed-opal: Set MBRDone on S3 resume path if TPER is MBREnabled Scott Bauer
2017-08-31 20:10 ` Jon Derrick
2017-08-31 19:58   ` Scott Bauer
2017-09-01  7:31     ` Christoph Hellwig
2017-08-31 20:19 ` Jens Axboe
2017-08-31 20:13   ` Scott Bauer [this message]

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=20170831201320.rd4agb7jxae7xh6e@sbauer-Z170X-UD5 \
    --to=scott.bauer@intel.com \
    --cc=axboe@kernel.dk \
    --cc=david.fugate@intel.com \
    --cc=hch@infradead.org \
    --cc=jonathan.derrick@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=rafael.antognolli@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