Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1184438rdd; Wed, 10 Jan 2024 11:07:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDUmUskk/CzSLaVppbVvMC3S/w44ddvOb1BPBYNFVSY+pfwdtAxXI/MiqxcQubX669NuzU X-Received: by 2002:a50:d7d5:0:b0:557:3f54:e94a with SMTP id m21-20020a50d7d5000000b005573f54e94amr736069edj.4.1704913674917; Wed, 10 Jan 2024 11:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704913674; cv=none; d=google.com; s=arc-20160816; b=uY1sig6auBRrFMbCC4tZTd7YRknOZj2grucIw2iCVQ9DPajO1vvzi0LgyLMSRRfOo3 u8JyZVFHr+iJkHpvBFzqQx7yPdatxvLnnu2bxfIpL0xD3doKoBITIdA7XNMvwRlZxmVs PKViLbkP9a5GddfMpmLqCO6jXxE/fr0qgEZCciwUFyLIF6+p2aCYBQTqalLla/TpyG+6 MA+v8UVXw+KS3hiDNx6zqqGT0AdKSscc5nmcI2w9lB4Tws+/vLz65f/SaR+aK69hD+vX 06yrQOQ5wQw2z1TNBiVEB0bbqg+j/Ff0qh4H5EOajR9/jyZKEoL4+hIA5YDGeugnDdTA M+Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+P+xtDPwcW5Zm5Sc54Zw2llE/L7aQj0xQovZZhL7NkQ=; fh=pme92c3fELrwHxjZimR1DTRUj4/x+hAvJCZ7W/A//oo=; b=jUa0prsrSXT0dULnh66+4y2UabwiG2N4pR39aflWsBUUNB43ZffRwjCqSh+YVcs7yc E9SBUuGfQaaYVZ99OgkwhGHz7VRM82BJ1QeD6xOFL8ckJNwHepJj9QiOPn5COU+gflWX yx6mq6KEYNfroihE3bKQ3/196lIrpTh6gIimNFA39pGMgk4h5JV0Jt8nvO9VW+a+4jMn Zxl56Hz0mp67JFUrwJ5EjGWOV6AnomuRwrtXa4AGrnqbEbK2h4ixo2kzxhjzpcdRM4Cp nU78BFshpRPqRN2R49lR1YhRhEXn+ltctroe7CbIpKyG7kYPyb3L4QH4gIN+Vz6+WKpt HR+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oGvqgTZ+; spf=pass (google.com: domain of linux-kernel+bounces-22642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22642-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q5-20020a50cc85000000b0055590da3330si1957613edi.623.2024.01.10.11.07.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:07:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oGvqgTZ+; spf=pass (google.com: domain of linux-kernel+bounces-22642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22642-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A901C1F21190 for ; Wed, 10 Jan 2024 19:07:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8ED204E1C8; Wed, 10 Jan 2024 19:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oGvqgTZ+" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D3843FB33 for ; Wed, 10 Jan 2024 19:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40d5336986cso58417225e9.1 for ; Wed, 10 Jan 2024 11:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704913658; x=1705518458; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+P+xtDPwcW5Zm5Sc54Zw2llE/L7aQj0xQovZZhL7NkQ=; b=oGvqgTZ+JwBFhUDlM/eSPcQBXFf8eOSdeuLauP7A4I/1wAK3mVCU62g6JBATi686Sv efXvnkdRjBxN4ouEnHxGIQ+J0Ea6WJPJs2sTF1IEsiIs28kKlS4ThYXPhrF7dYGTVRFo iN0EN74ZdY1Ogv1ZB5fqO2adKNG4pACPmjdjJ665XB4r/hShI2gLwO/PpYpHW9eRvdEO tpmh+B5SJdwa5zo4iL8h0S6zlAG6OQL4UQfH9YROFOSkR9wgTmwww2Exj2/8l3IAH9Ag mcjcRxoJVApkDVOseXIl3hw9+GOBkE5AHYlUMjgc7TmWQgMR5PhmQcyR9NwbdWvLvuHL gXjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704913658; x=1705518458; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+P+xtDPwcW5Zm5Sc54Zw2llE/L7aQj0xQovZZhL7NkQ=; b=d/bU24xnySgbSBggmZmjrZaJ4WvVC7ya9MMg/o6uJZiFlEjr1vU8F+mr14t7nNha+y UHOmXUNaWqF6GfwKxew4/QRf4jw1Z66mhDcQHe6NX+va/5TyrCjFlGeT6d3lQofX3lbK eOmhjObpzDIETx+R14EyguyI/PXrzVa7o8GP9DMSS8KayDucR2AMZJ4qdFntjNc9bWd5 lrdHgAp077RskkhktHeTMKnHWDd1XbDF9GDRpckvZOBPL33qUlgGNt+8DXujeUlSS5Va rVL4gBqhCmmJJlyphKcLkCrEOhIsDVrydYDj40d7hvB5osfM4zawBx7chfUoJTk5tU1Z v16w== X-Gm-Message-State: AOJu0YyFaCKbDgEjCzZFC+bnlFr/WzvgVrEx3iqOXa/pHScqlrRcOI/7 prn3LWrz8rES14PLZnHfGqHxFX4O9xnHnw== X-Received: by 2002:a05:600c:1908:b0:40e:45a3:dcb7 with SMTP id j8-20020a05600c190800b0040e45a3dcb7mr769999wmq.116.1704913658186; Wed, 10 Jan 2024 11:07:38 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id z6-20020a05600c0a0600b0040e49045e0asm3102410wmp.48.2024.01.10.11.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:07:38 -0800 (PST) Date: Wed, 10 Jan 2024 22:07:34 +0300 From: Dan Carpenter To: David Howells Cc: Jeff Layton , 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() Message-ID: <6ec71521-66ec-4da8-ad3e-2037cdde4287@moroto.mountain> References: <9872f991-56a8-4915-b9b0-53accd6db0ef@moroto.mountain> <1788108.1704913300@warthog.procyon.org.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1788108.1704913300@warthog.procyon.org.uk> On Wed, Jan 10, 2024 at 07:01:40PM +0000, David Howells wrote: > Dan Carpenter 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. Ah... Right. I misread what was going on in the latter part of the function. Sorry, I'll resend. regards, dan carpenter