From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f66.google.com ([209.85.208.66]:42795 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbeJRAp3 (ORCPT ); Wed, 17 Oct 2018 20:45:29 -0400 Received: by mail-ed1-f66.google.com with SMTP id b7-v6so25507645edd.9 for ; Wed, 17 Oct 2018 09:48:56 -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> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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