On Thu, Feb 16, 2017 at 12:07:08PM -0800, Christoph Hellwig wrote:
> On Thu, Feb 16, 2017 at 11:45:29AM -0700, Scott Bauer wrote:
> > > + if (check_opal_support(dev) < 0) {
> > > pr_warn("Opal is not supported on this device\n");
> > > - opal_dev->initialized = true;
> > > + kfree(dev);
> > > + return NULL;
> >
> > We're going to have to change this check_opal_support to be != 0 instead of
> > < 0.
>
> Yes. And we should simply turn all these printk into pr_debug anway -
> not having OPAL is a prefectly fine condition, no need to spam the log
> for it.
>
> And btw, I think we should check for bit 0 in OACS before ever doing
> a security send / receive.
That sounds reasonable. It can go in the nvme_send_recv function before we
actually attempt to send anything. The code paths fall nicely in that when
we attempt to look for support we have to do a discovery0 which will fail
on the OACS bit and we'll deallocate everything.
I'll spin this up now.