Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2416836ybi; Sun, 9 Jun 2019 11:13:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRdP3YzPDM1UA5s2TPK2ctYKerZc4ygOsw0feg5WS9K7tnL8YsKs7zJFqZY6e90+nBxkDt X-Received: by 2002:a62:188d:: with SMTP id 135mr66326719pfy.222.1560104010093; Sun, 09 Jun 2019 11:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560104010; cv=none; d=google.com; s=arc-20160816; b=xdEDhxTXQM8goDhg+at3pxUK+T8feOZ/K7+SbAZJVL2Egm9NrMkFXm7kMv8GdNKfOg xpKg2n6HPNHMscnfImKyf58YbDV6edUBurgcS6q1M5OT2D9RZ1MfyTj1aNMa61qelQ4E xo+YMzq3mvskzUcz2svdqF1EYZ2OlSLwcrq9EFShzHDCadKeLmUMrjbz8JUaAuabDiPU Zvt3fMvBl2rcgvsJoO5ooW5KVsR9TP/woxv7YbvU+9VqPZIv2NE6KeR3vehP4zEbUJb0 uu4AtbKZazxdfBWHclwHYuZZuIEeBixmk84FqWOYbn0c7rR+9pGjmtIvstQaHIDUg2Rr 5fRQ== 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=9jwH+l9xCCeS/xDxIo29vCX6PcJjgmZP7ov/kPcBJ6o=; b=fKK3Y5LziaFITNouYua19uGBYoMOz/gPC6MxbehIshbHux0OuT6fh7kpnmJHhrJTyE 18CSHwfVQ2iC2JnjLAmYTYsGNPla15p+2TcaafktRs2MuNu843uaXNqaopMG2zazAymp q/EiALiWOxoho9wRMxp0eZST8aCsVemeB3dXn/wijIv1hfb+PldoEbzCeA9osJc+kzXm 7ewA0QR3PVkmShto516UJjlnbR4G/VYePXVWtfDQdABodmC4sl0W+IqAW+MdOHALjXN6 xZ5US1JTbeGgbtFGfoRcuZzgxZ1652KTK5sFnGlD9MdsqDDu4/UjmQBYhsbpAaPajXta KZLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KRHxLhAv; 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 q85si8610273pfc.85.2019.06.09.11.13.14; Sun, 09 Jun 2019 11:13:30 -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=KRHxLhAv; 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 S1732644AbfFIQ7L (ORCPT + 99 others); Sun, 9 Jun 2019 12:59:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:34736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732775AbfFIQ7H (ORCPT ); Sun, 9 Jun 2019 12:59:07 -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 14804206C3; Sun, 9 Jun 2019 16:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560099546; bh=NRvK615v25GoOdRPL360NWzr60LSRHxx997j8H+H/mo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KRHxLhAvXIUOIxJ+/leHOGmXSxQOdvS+lpPIPlphjzGgH1IGoFgyUCUQJR7uR+5jT mfAsRAqc1j8vGqGOniWPb03Of9QT3gD1fvf1+a9+Lw1fa6JE76y3lYEJYGA+9+pWSn wxPdTa5vc3W0SFOBTzhSFxTl+C9VYNz0LbUydbvY= 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 , Ming Lei , Jens Axboe , linux-block@vger.kernel.org Subject: [PATCH 4.4 078/241] bio: fix improper use of smp_mb__before_atomic() Date: Sun, 9 Jun 2019 18:40:20 +0200 Message-Id: <20190609164150.022547203@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164147.729157653@linuxfoundation.org> References: <20190609164147.729157653@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 f381c6a4bd0ae0fde2d6340f1b9bb0f58d915de6 upstream. This barrier only applies to the read-modify-write operations; in particular, it does not apply to the atomic_set() primitive. Replace the barrier with an smp_mb(). Fixes: dac56212e8127 ("bio: skip atomic inc/dec of ->bi_cnt for most use cases") Cc: stable@vger.kernel.org Reported-by: "Paul E. McKenney" Reported-by: Peter Zijlstra Signed-off-by: Andrea Parri Reviewed-by: Ming Lei Cc: Jens Axboe Cc: Ming Lei Cc: linux-block@vger.kernel.org Cc: "Paul E. McKenney" Cc: Peter Zijlstra Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -290,7 +290,7 @@ static inline void bio_cnt_set(struct bi { if (count != 1) { bio->bi_flags |= (1 << BIO_REFFED); - smp_mb__before_atomic(); + smp_mb(); } atomic_set(&bio->__bi_cnt, count); }