All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: gjoyce@linux.vnet.ibm.com
Cc: linux-block@vger.kernel.org, keyrings@vger.kernel.org,
	dhowells@redhat.com, jarkko@kernel.org,
	jonathan.derrick@linux.dev, brking@linux.vnet.ibm.com,
	greg@gilhooley.com, gjoyce@ibm.com
Subject: Re: [PATCH 3/4] block: sed-opal: keyring support for SED Opal keys
Date: Wed, 20 Jul 2022 00:49:05 -0700	[thread overview]
Message-ID: <YtezcSA4c4cccQZQ@infradead.org> (raw)
In-Reply-To: <20220718210156.1535955-4-gjoyce@linux.vnet.ibm.com>

I don't know the keyring code at all, so just some nitpicks here:

> +	kref = keyring_search(make_key_ref(sed_opal_keyring, true),
> +			      &key_type_user,
> +			      key_name,
> +			      true);
> +
> +	if (IS_ERR(kref)) {
> +		ret = PTR_ERR(kref);

Just return directly here instead of indenting the main path.  Also the
parameter list and empty line here look odd.  Why not:

	kref = keyring_search(make_key_ref(sed_opal_keyring, true),
			      &key_type_user, key_name, true);
	if (IS_ERR(kref))
		return PTR_ERR(kref);

?

>  	ret = execute_steps(dev, pw_steps, ARRAY_SIZE(pw_steps));
>  	mutex_unlock(&dev->dev_lock);
>  
> +	if (ret == 0) {

	if (ret)
		return ret;

and avoid the indentation below.

> +	ret = update_sed_opal_key(OPAL_AUTH_KEY, init_sed_key, keylen);
> +
> +	return ret;

	return update_sed_opal_key(OPAL_AUTH_KEY, init_sed_key, keylen);

>  
> +enum opal_key_type {
> +	OPAL_INCLUDED = 0,	/* key[] is the key */
> +	OPAL_KEYRING,		/* key is in keyring */
> +};
> +
>  struct opal_key {
>  	__u8 lr;
>  	__u8 key_len;
> -	__u8 __align[6];
> +	__u8 key_type;
> +	__u8 __align[5];

Can we assume this was always zero initialized before?

  parent reply	other threads:[~2022-07-20  7:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18 21:01 [PATCH 0/4] sed-opal: keyrings, discovery, revert and key store gjoyce
2022-07-18 21:01 ` [PATCH 1/4] block: sed-opal: Implement IOC_OPAL_DISCOVERY gjoyce
2022-07-20  7:42   ` Christoph Hellwig
2022-07-18 21:01 ` [PATCH 2/4] block: sed-opal: Implement IOC_OPAL_REVERT_LSP gjoyce
2022-07-20  7:44   ` Christoph Hellwig
2022-07-18 21:01 ` [PATCH 3/4] block: sed-opal: keyring support for SED Opal keys gjoyce
2022-07-19  6:49   ` Hannes Reinecke
2022-07-20  7:49   ` Christoph Hellwig [this message]
2022-07-18 21:01 ` [PATCH 4/4] arch_vars: create arch specific permanent store gjoyce
2022-07-20  7:50   ` Christoph Hellwig
2022-07-26 18:53     ` Greg Joyce
2022-07-28  7:43 ` [PATCH 0/4] sed-opal: keyrings, discovery, revert and key store Jarkko Sakkinen
  -- strict thread matches above, loose matches on Subject: below --
2022-07-06  2:39 gjoyce
2022-07-06  2:39 ` [PATCH 3/4] block: sed-opal: keyring support for SED Opal keys gjoyce

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=YtezcSA4c4cccQZQ@infradead.org \
    --to=hch@infradead.org \
    --cc=brking@linux.vnet.ibm.com \
    --cc=dhowells@redhat.com \
    --cc=gjoyce@ibm.com \
    --cc=gjoyce@linux.vnet.ibm.com \
    --cc=greg@gilhooley.com \
    --cc=jarkko@kernel.org \
    --cc=jonathan.derrick@linux.dev \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.