All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Ilya Dryomov <idryomov@gmail.com>, ceph-devel@vger.kernel.org
Cc: Alex Elder <elder@linaro.org>
Subject: Re: [PATCH] libceph: kfree() in put_osd() shouldn't depend on authorizer
Date: Wed, 18 Feb 2015 09:47:51 -0600	[thread overview]
Message-ID: <54E4B427.9080002@linaro.org> (raw)
In-Reply-To: <1424266039-40851-1-git-send-email-idryomov@gmail.com>

On 02/18/2015 07:27 AM, Ilya Dryomov wrote:
> a255651d4cad ("ceph: ensure auth ops are defined before use") made
> kfree() in put_osd() conditional on the authorizer.  A mechanical
> mistake most likely - fix it.

You are generous in suggesting it's a mechanical mistake.
But it is a mistake nevertheless.  The fix looks good.

Reviewed-by: Alex Elder <elder@linaro.org>

> Cc: Alex Elder <elder@linaro.org>
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
>  net/ceph/osd_client.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
> index f693a2f8ac86..41a4abc7e98e 100644
> --- a/net/ceph/osd_client.c
> +++ b/net/ceph/osd_client.c
> @@ -1035,10 +1035,11 @@ static void put_osd(struct ceph_osd *osd)
>  {
>  	dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref),
>  	     atomic_read(&osd->o_ref) - 1);
> -	if (atomic_dec_and_test(&osd->o_ref) && osd->o_auth.authorizer) {
> +	if (atomic_dec_and_test(&osd->o_ref)) {
>  		struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth;
>  
> -		ceph_auth_destroy_authorizer(ac, osd->o_auth.authorizer);
> +		if (osd->o_auth.authorizer)
> +			ceph_auth_destroy_authorizer(ac, osd->o_auth.authorizer);
>  		kfree(osd);
>  	}
>  }
> 


  parent reply	other threads:[~2015-02-18 15:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 13:27 [PATCH] libceph: kfree() in put_osd() shouldn't depend on authorizer Ilya Dryomov
2015-02-18 15:18 ` Sage Weil
2015-02-18 15:47 ` Alex Elder [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-02-18 13:27 Ilya Dryomov
2015-02-18 13:34 ` Ilya Dryomov

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=54E4B427.9080002@linaro.org \
    --to=elder@linaro.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.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 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.