Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp473510yba; Wed, 15 May 2019 04:46:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCW52bCQDVK5W/fqE8K1ullFTib1IktQl2/J5QPiOdUHmYdICv1XXCFxI6rE087NM2mpXg X-Received: by 2002:a65:5941:: with SMTP id g1mr43880758pgu.51.1557920775720; Wed, 15 May 2019 04:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920775; cv=none; d=google.com; s=arc-20160816; b=PhLe0yf+zU3uiakCEOTzEWYocR8nFa17HM/lRNO93CTa5YzjUsS+Jn3g1r+ZjgQaJB TRzoPiC8gbNpYJiNORr1Uagk0MGWDWOmGO77RHfw0a2iN4GO8Wl/UfxpQa5GocXVgbeP 8o5ewX72eWOE6/PQP0pEreOMEJ1eKFIogdmB4GeIaZ09JYZ2a34CH8fuVmYO/HVpOYtF lKsgf1PzDrBNNpMCBcvfQ7enL3wIecad2KPlY0Zuzj7zyIeDiOPTBPTEibV6qBHgon8M /foM9pIxJEMboJSfcT3WEVEk8qHHoa5/nUx7N1zEm45mCfrJSfLAkq2/eG/9WPe/wXNH leMw== 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=EHhnl27HvavnLltbL4JKpXCUt8Kz7QVkKErFi8dzklY=; b=fG8YM27z823B9MBXIz4h6hu6vokJ0886b2K6Qp8Ha0vDvfCJ47X1N/A4f0MT3fXyNb RjnAFHCR4Jk2OHtqiZcoXmsddMloFwaoSp9HFCmVn2Ot1zau6T+KhEmhxN+Cixg+WAIX +JE3nmilPQdnxR5VgvzCFWoXT2Rca5+nQBxI61vQz8c1sCx6rgTTZZBogeOptXm8v0LX qfN0NOTXKeh+fHmoq2l059jXR8KesG3DRozPMgXV1YJNpOXaQcF6s4PlFZ+Vbl2kr9wy 8PDyZvtxYQQ5nxZ96Y3QsPcdCHFghpOE31HGe/sF/BVH1H42cEhP0H1Jdv1on6l3yfSR Fucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gqoFVGP7; 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 e64si1876086pfe.178.2019.05.15.04.46.01; Wed, 15 May 2019 04:46:15 -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=gqoFVGP7; 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 S1732141AbfEOLny (ORCPT + 99 others); Wed, 15 May 2019 07:43:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731294AbfEOL1G (ORCPT ); Wed, 15 May 2019 07:27:06 -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 2B4CA20862; Wed, 15 May 2019 11:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919625; bh=vVfQY6gZu/OlDcM6tuuouwA74XHWGJMpGlcOZoThUis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqoFVGP7NORUzlFoXlprtjs6Fy1Uqi7iA0eByrEItMC+YsHiEWB7WWBrZ39atPEfj EEK+QAG5jHyYqWRguiuPMsjMhhIFusI/Xxt5czMEBBDdWSpRjf/EL2pYyf0O1CntjJ zX1JsH6mhSq8rhBqjJnBb6vM/B3bfJ59MBE0c/Zk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrea Parri , Tejun Heo Subject: [PATCH 5.0 008/137] kernfs: fix barrier usage in __kernfs_new_node() Date: Wed, 15 May 2019 12:54:49 +0200 Message-Id: <20190515090653.432205540@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@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 From: Andrea Parri commit 998267900cee901c5d1dfa029a6304d00acbc29f upstream. smp_mb__before_atomic() can not be applied to atomic_set(). Remove the barrier and rely on RELEASE synchronization. Fixes: ba16b2846a8c6 ("kernfs: add an API to get kernfs node from inode number") Cc: stable@vger.kernel.org Signed-off-by: Andrea Parri Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- fs/kernfs/dir.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -650,11 +650,10 @@ static struct kernfs_node *__kernfs_new_ kn->id.generation = gen; /* - * set ino first. This barrier is paired with atomic_inc_not_zero in + * set ino first. This RELEASE is paired with atomic_inc_not_zero in * kernfs_find_and_get_node_by_ino */ - smp_mb__before_atomic(); - atomic_set(&kn->count, 1); + atomic_set_release(&kn->count, 1); atomic_set(&kn->active, KN_DEACTIVATED_BIAS); RB_CLEAR_NODE(&kn->rb);