Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp890403imm; Wed, 17 Oct 2018 09:49:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV63ke0of6xTeRtxKblsKpS9i0Rz6g7zhMOvbW9OLMov11hs1stiWGPChhG9AszDKJ5cKmcJK X-Received: by 2002:a17:902:7246:: with SMTP id c6-v6mr15092707pll.45.1539794984877; Wed, 17 Oct 2018 09:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539794984; cv=none; d=google.com; s=arc-20160816; b=y0BORS6CZOLq8dljK/BvfXN6yL7VWJlaCfzt6jUVQqKd++H4QZG7thD5CYuTIL3vyA 4upM6vBEhA8UEx3uxwCLYLC7OEGQ6EHKhH1KkzVc8eXNvICau4VoEd1+URD740W9Eq/2 nDFZ2Qp2R69RUBnHqwmyF4I5svxv57SUy6NBYclz/QlOPSKHjgpbXDOwcB7RtijZqpaf OvxDyw4Fb9/9zim8r3OA0q0Z2BDBxJIJFoygP2/4yWbrAwCL/j74EjoqWg8peSWBZ1NF T8KmqSxyIdErAU02jhNCajPgZxb3pQar2IpBLRBxt1LklpfSRAhwtk/5spxgiwrjH1NP AMHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xcDmeePrpewnH6pESDvdQ4mHrQ6Kc4wKvGV2Wd6BQJM=; b=m6yVJJkvWCzzL802q3bQ6la98siXLFkNigtdlOSS9JTVwsh4nr8jZUuqEpdbHpZiHy PPtzu5Gl3LYjws2xb1cXsKRMaszRBvrYIIAqHWMrk+T6zkM2h1KIWR4PeIp6j5p76XRb J3RrbnWB/63Kb6KB1JA9xqFIPELgIm53keS0Jt854YO2i96vwJ8rYDd+PH2ddt8JeY64 yI6e1IVdvBErECPySbPCbD4eMXUUkNQv980J4H2lBaJqEjuUVNkYGaH2WXcH50NaJGQu 7H8XMBpYL7wMgccXBxDsMmMHFJGvFROl3aEOwTwGD5VmfYkDFC93EJBTFHYOd7F/2NT1 ZrOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iUPxVU4V; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203-v6si17021597pfv.101.2018.10.17.09.49.28; Wed, 17 Oct 2018 09:49:44 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iUPxVU4V; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727309AbeJRAp3 (ORCPT + 99 others); Wed, 17 Oct 2018 20:45:29 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:43956 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbeJRAp3 (ORCPT ); Wed, 17 Oct 2018 20:45:29 -0400 Received: by mail-ed1-f66.google.com with SMTP id y20-v6so25516757eds.10 for ; Wed, 17 Oct 2018 09:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xcDmeePrpewnH6pESDvdQ4mHrQ6Kc4wKvGV2Wd6BQJM=; b=iUPxVU4V8sWrEDpQAjBpz6CjYAEsUoNWb0f82ZCecAM0BrbuG/hVNXVW1GvtItjapi Vsu17ldOUH4zIIS5Btrc+9X1NLNOuTzSQIH/7mFksc1Cll7G8Rb5MPsX7ei1sDoJY2br feMJyeIeKDAoAUbF7l/+SqudXbCTmpYdWk6+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xcDmeePrpewnH6pESDvdQ4mHrQ6Kc4wKvGV2Wd6BQJM=; b=hqyH3wCwPa98TNfIX4i5cZYuAYQFluk1n7jYniohSbiXtpfvac6SjVpkTYh2MX3FR3 f96MybQ/XhN8yUSi0BxJ3j0TMymG5y2N7ZGmqQyHI4vWjFzDYVD4tWlfymtvP5u96uIE 1VTNzfGkTqK3VFx9eJIZqpzUK3NlQICr347+P9gYEdjxze1RVor2QCLJmBOtMKIBzSVW RWuNTvObf5Yb+SWKPqVhV61IEPBQM2xFwfZiCRHCLwjjm19iHSv9SeNAPM1nsNAJjfqW 2Z+NMh8aVBrawjEAG5lTIOU+SFl/cv2ctnXSv7zU4Dr+Uoyr51WP0hMfwJnSEQQ+pqTk qAJw== X-Gm-Message-State: ABuFfoj5k8NG1k5vZC3pY3XkDWHj3PUqM1A4f/6uK0vHGTUyepIlcNfJ fxl9jgD2XzX3j+qKtDd7Pm5mkA== X-Received: by 2002:a17:906:64c:: with SMTP id t12-v6mr27436292ejb.113.1539794935762; Wed, 17 Oct 2018 09:48:55 -0700 (PDT) Received: from andrea (15.152.230.94.awnet.cz. [94.230.152.15]) by smtp.gmail.com with ESMTPSA id a3-v6sm3713090ejr.55.2018.10.17.09.48.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 09:48:55 -0700 (PDT) Date: Wed, 17 Oct 2018 18:48:48 +0200 From: Andrea Parri To: David Howells Cc: 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 Message-ID: <20181017164848.GA9795@andrea> References: <20181017151134.GA8966@andrea> <153978619457.8478.3813964117489247515.stgit@warthog.procyon.org.uk> <153978621809.8478.2198040871218302573.stgit@warthog.procyon.org.uk> <14408.1539790333@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14408.1539790333@warthog.procyon.org.uk> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 17, 2018 at 04:32:13PM +0100, David Howells wrote: > 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()? Hard to tell for me: your diff./changelog is all I know about fs-cache ... (and this suggests -no-, given that atomic_sub() and atomic_read() provide no ordering...); good question though. ;-) Andrea > > David