mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: dhowells@redhat.com, Jeff Layton <jlayton@kernel.org>,
	linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] netfs, fscache: Prevent Oops in fscache_put_cache()
Date: Wed, 10 Jan 2024 19:01:40 +0000	[thread overview]
Message-ID: <1788108.1704913300@warthog.procyon.org.uk> (raw)
In-Reply-To: <9872f991-56a8-4915-b9b0-53accd6db0ef@moroto.mountain>

Dan Carpenter <dan.carpenter@linaro.org> wrote:

>  	zero = __refcount_dec_and_test(&cache->ref, &ref);
> -	trace_fscache_cache(debug_id, ref - 1, where);
> +	trace_fscache_cache(cache->debug_id, ref - 1, where);

You can't do that if !zero.  cache may be deallocated between the two lines.

David


  reply	other threads:[~2024-01-10 19:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 18:54 Dan Carpenter
2024-01-10 19:01 ` David Howells [this message]
2024-01-10 19:07   ` Dan Carpenter

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=1788108.1704913300@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=dan.carpenter@linaro.org \
    --cc=jlayton@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®