Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2765799ybh; Mon, 5 Aug 2019 06:30:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3RPNH0AroJI6YUGKcDshkBVV4WGevK1UoELoR2yTIxpcNB0pVwn1PMOSOFY2tK4SYCeL0 X-Received: by 2002:a17:902:1129:: with SMTP id d38mr146237714pla.220.1565011840579; Mon, 05 Aug 2019 06:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011840; cv=none; d=google.com; s=arc-20160816; b=vQGVN65fXUdXNSBQ+88oK3hfag6UlOOGFA3EupKND08eNmYl2o6mzeXKsxOGQHaCRl UsGGO1c/ZLJKr6zI73gt7ceo2WAJcrRA5G1GcVE9JtkX55XllMPyLoanxiSq5aqg1NML rJVF8IXpi0smp4+6VMoGYI5qnvCo3B1LJ3cyGQUq3enKemjMZ6QMrLGsqni+zky9Sq03 0x87D1M665MValKvOUn2eJ360AIQ9DVx+IUnDWSDvgh0LGLGIZWAERye41txuEEvS5AK LngLypNJqLm6nD/VjEXmukO+bpaJeKcopC3pMa/HLCJobDxKvg6AO6wP4yG3ags0M4L+ khbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7jK5aPe7WIzTE5fKDBf5dE1s2xvGoVykwO5hxWu7bXY=; b=vA7ZvFxhdNqv5skqrMJw6zCXRjkVphVP1LfdEqJV1pRa+MkQGT1tyH1IDPHSgR/zk2 KB7WSJu1rFwvQgdF1I8UbGR8nbb8ez3dSfmYkHvpiKY8WRdW0K9RJdxryfLZ1c6loBlR ARnz0JT984dv1xOFeHexPalgAmY5ysUk4jXsQmUEZF+Tud9rjBsAdMEwkhlrcnA4T3e+ tnSTlmZ/Fmr4HtejHUSnWkyP7i8FBeGHBtNHhCQ2i3Ul0pfmxQPNdctfmlAFJPKwf4bw hAWdjOx1iC3tbA6i9xXcIiYRndSp27H13f8CIEZO2D2RfoXCpI2SCvsXnBCqO3NZyhnt 9kDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DigtdGd0; 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 b22si12953480pjb.82.2019.08.05.06.30.24; Mon, 05 Aug 2019 06:30:40 -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=@kernel.org header.s=default header.b=DigtdGd0; 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 S1730840AbfHEN3x (ORCPT + 99 others); Mon, 5 Aug 2019 09:29:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:57502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729962AbfHENVU (ORCPT ); Mon, 5 Aug 2019 09:21:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 51F312075B; Mon, 5 Aug 2019 13:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011279; bh=T48npYXpwQ+wHXrgIa7n0neno7aLyYJh/ORAU4PfIDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DigtdGd0IcfQMmTkWOV+cAbK79fVJ7gkcwq8/Wlh6+yPlCGgBn+pldbjL3fpD7jxb kwG5+mIffdNDlMJtWAXTCyvnfothGyZSrzSjOvUMPFPbez1TWdlpBTU+9l/V7x1b6i mlwOwJGGK2150+LkH9hzxffIzPCdDmU9/5zFkN04= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra , Andrea Parri , "Yan, Zheng" , Ilya Dryomov , Sasha Levin Subject: [PATCH 5.2 032/131] ceph: fix improper use of smp_mb__before_atomic() Date: Mon, 5 Aug 2019 15:01:59 +0200 Message-Id: <20190805124953.582609540@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 749607731e26dfb2558118038c40e9c0c80d23b5 ] This barrier only applies to the read-modify-write operations; in particular, it does not apply to the atomic64_set() primitive. Replace the barrier with an smp_mb(). Fixes: fdd4e15838e59 ("ceph: rework dcache readdir") Reported-by: "Paul E. McKenney" Reported-by: Peter Zijlstra Signed-off-by: Andrea Parri Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- fs/ceph/super.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/ceph/super.h b/fs/ceph/super.h index edec39aa5ce20..1d313d0536f9d 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -544,7 +544,12 @@ static inline void __ceph_dir_set_complete(struct ceph_inode_info *ci, long long release_count, long long ordered_count) { - smp_mb__before_atomic(); + /* + * Makes sure operations that setup readdir cache (update page + * cache and i_size) are strongly ordered w.r.t. the following + * atomic64_set() operations. + */ + smp_mb(); atomic64_set(&ci->i_complete_seq[0], release_count); atomic64_set(&ci->i_complete_seq[1], ordered_count); } -- 2.20.1