Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp804920imm; Wed, 17 Oct 2018 08:34:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV62jbpencS4GBdDNsa+UtI5pCQeuDvvTtSDqliLIKkAxEllIojdkaREqBaXRmDIincM57cNX X-Received: by 2002:a17:902:f096:: with SMTP id go22mr26672330plb.235.1539790472835; Wed, 17 Oct 2018 08:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539790472; cv=none; d=google.com; s=arc-20160816; b=MR/P/GRb151Fh96iwcZEkpxurF2GR3ZdmigrfYH2GY69BWwackhkj6a+e0TKVB/GUh jxX8swXTENuebrK28B1xRfslM2ds+SSsAqW9VXReX7RxhzX6xmcCndLXTEqblIDiNBQq TAjP8PiH1PyPaofg6WbbqR9h4/QrVqOIby82+lNQBi8nCxy0CM+n4+lu3V3VhJhnZBDO Yw+m/Yhfa/uL367ogF6aktwe3AToG9KSati3kpXWprkpu8sH3U3iBh3ZVNDd5UY61L2P CyJRIoSoLJThQrWS5AJmxahD+4hDwdo3rhzjB06eeR4BcORabMpH6UkTrvC4EdARUvb9 WF3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization; bh=YBdXkbaN4tHORhi4YhhtRmwnmJMZ9tBKesxNZG7BCO0=; b=lqtZuv9JA383gnCqfUAKphrtJN9enCgdBns0h6ekeaGHxgu2Hx/ijC/6snOxynI8Kl x89lZgmA0+VovGUL37IFD3x+TfYf7Yv+GUPFlHCRL6Q+YQib7Sd1Qav++ge1VLtx7TPU Ds+4xo2wp+XLyf929BMo3LPZZuTtNivYWSV/o5UwvorWRL8KbZZ0Uh+DplhiAIn8zNnI tdcCGjtpNLoJBiieKdTUJoLdjNcx+POm6VqADtx1iJ6jNPiz9GsY68ieDMTdqEiRyTRb 2HJ2qHETk8npUKB/fJsEPIu+q5k8wtmNjBnQga5Ov+hD9ch3auKhJHvF3Z6WpUVRBb3z XWzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o186-v6si19355152pfo.236.2018.10.17.08.34.17; Wed, 17 Oct 2018 08:34:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbeJQX2d (ORCPT + 99 others); Wed, 17 Oct 2018 19:28:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49781 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727090AbeJQX2d (ORCPT ); Wed, 17 Oct 2018 19:28:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1045D356D5; Wed, 17 Oct 2018 15:32:20 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-250.rdu2.redhat.com [10.10.120.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A32E7842C; Wed, 17 Oct 2018 15:32:14 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20181017151134.GA8966@andrea> References: <20181017151134.GA8966@andrea> <153978619457.8478.3813964117489247515.stgit@warthog.procyon.org.uk> <153978621809.8478.2198040871218302573.stgit@warthog.procyon.org.uk> To: Andrea Parri Cc: dhowells@redhat.com, gregkh@linux-foundation.org, Kiran Kumar Modukuri , viro@zeniv.linux.org.uk, sandeen@redhat.com, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] fscache: Fix race in fscache_op_complete() due to split atomic_sub & read MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14407.1539790333.1@warthog.procyon.org.uk> Date: Wed, 17 Oct 2018 16:32:13 +0100 Message-ID: <14408.1539790333@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 17 Oct 2018 15:32:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrea Parri wrote: > > Fix this by using atomic_sub_return() instead of two calls. > > Seems a case for atomic_sub_return_relaxed()... why not? Ummm... In that case, should it be atomic_sub_return_release()? David