[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1788108.1704913300@warthog.procyon.org.uk>
Date: Wed, 10 Jan 2024 19:01:40 +0000
From: David Howells <dhowells@...hat.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: dhowells@...hat.com, Jeff Layton <jlayton@...nel.org>,
linux-cachefs@...hat.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] netfs, fscache: Prevent Oops in fscache_put_cache()
Dan Carpenter <dan.carpenter@...aro.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
Powered by blists - more mailing lists