Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4074144yba; Mon, 29 Apr 2019 13:17:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqym6Uz5TsVRSTjQGzMasgtDej6FP92XUO4ArQ4vGuwjkiZ/hpYNFGO9L/+3YZJPCN5VxwcW X-Received: by 2002:a17:902:7d8a:: with SMTP id a10mr12298859plm.167.1556569044691; Mon, 29 Apr 2019 13:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556569044; cv=none; d=google.com; s=arc-20160816; b=m90tsMnqYAPxBtBQ4cyA1hqpUN1uYAjXu+bNJWguZZUgPAaffIaSU1L0+XqY91yN83 SPhU6rGUvkShPp3p28YOwOmJrl0MJYhnfKG3fmMv2j4elzWR9xbTS+v/Y+edzwN9OECJ z7VlGFCC2Y1igxepoB9/hbblF3VbXzchtxpGhoLBLq9Z2ayMoXMgqlI5sCcPe2HcSSp9 hwbICYYtsVdW1wfA0fZGnBomoSymfQnEAlSsZhlKjE1ttUduvzDPmAkkEARjXJZV58Rj DliIjNQYjOifNGl2YYs/spYRD+qIhQNhMyr+9k97ymEKC31VsmOBjbI2Zlux9+BnEu+C tjFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HnQQB+q10KJ+tBjmTDVhEUeBuplkgzFkaabaWorIDK0=; b=ExXyynWeII5sMdZG3a1hZpmz2+q0crqq3TE1yoSQ75FTb8rVZT6ZSA9TtPbR+0O9yx E6od82FZzX2XzMSA9qqNWwH4ah9+DIi+AXeJwW+uOpee/QIo0t5EWr5eW2Nu2Fy6v36k eSrkCEcS9CImMEBV3wC0EqKBVtnWOVrh3Bs66AZFAVH/g8iEKKTKZilYqAeekYWShtrm gOJ/KeEJR6zQRlAuHAvgbYZ5HviEMEcQopcwD+wWaw3flIctA2GT0dMh1P3tCsb+vM+I Ci44WWg2PcWwG1igFvUwogZFpXN6aswhRNS9Et9I1HrpgbgeqMVLaqsB4FuD0OgeR9Vd sYhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=V8llIgXP; 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 e3si32968188pgc.98.2019.04.29.13.17.08; Mon, 29 Apr 2019 13:17:24 -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=V8llIgXP; 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 S1729425AbfD2UQB (ORCPT + 99 others); Mon, 29 Apr 2019 16:16:01 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33604 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729421AbfD2UQA (ORCPT ); Mon, 29 Apr 2019 16:16:00 -0400 Received: by mail-wr1-f65.google.com with SMTP id s18so17952155wrp.0 for ; Mon, 29 Apr 2019 13:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HnQQB+q10KJ+tBjmTDVhEUeBuplkgzFkaabaWorIDK0=; b=V8llIgXP6nhj3mBW9/AXO9OGQRGRnVOgd/Mgx/UqS0Dmg6P71DCInuxWyizpcBDv2v s4LWS3ulfKwPBDJxaH97b/cxsArPA7/vK6pLhrgQwPdEmqCASyvUl8VDq6EE/M867QlH vuLUSwu+6ZvKtN0hQBgi2CjSm7a1FwV/4h3/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HnQQB+q10KJ+tBjmTDVhEUeBuplkgzFkaabaWorIDK0=; b=CK9VZLpFdm97pDkeyCoNm/0ERIlNFBxTFixeHTW9H8RBgo5BIvdNmmh4Zms/PjqS0R G4BJboobe90JEU7SoZoBQCTkwpL1wGN3/31llBzzHjMzePu8uSefk1mjqXcOZdzYywuU uyF9DGFs0cPE+Tn4fQBttzdxS16x8ms0tS5s90UmyCYZcYK5UhxlV1bHwUvHfWxQK5sv 20hyR2KV6U9ooFxv+wrWwfsKp7BPTt0kuHmj0qLaXcbcK59vQcEknYrLJKUBreaHpmVj dWFiWX75jR+rSotyePaira/EoZrowJASMIk8ZDL4/9seCLcZ4MB4/VSUYxMlmMAnpOlk bk2A== X-Gm-Message-State: APjAAAU2zj9OEMrrdEiGVn+YUYze10+SAhKTjJtRkfpyrkdjjoFiqWN1 lNB0sgC6Dl1+sM2Kyp5jO8nicsDtA+0= X-Received: by 2002:adf:fb4a:: with SMTP id c10mr13358709wrs.309.1556568958675; Mon, 29 Apr 2019 13:15:58 -0700 (PDT) Received: from localhost.localdomain (ip-93-97.sn2.clouditalia.com. [83.211.93.97]) by smtp.gmail.com with ESMTPSA id k6sm22864019wrd.20.2019.04.29.13.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Apr 2019 13:15:57 -0700 (PDT) From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Andrea Parri , stable@vger.kernel.org, Jens Axboe , linux-block@vger.kernel.org Subject: [PATCH 2/5] bio: fix improper use of smp_mb__before_atomic() Date: Mon, 29 Apr 2019 22:14:58 +0200 Message-Id: <1556568902-12464-3-git-send-email-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Jens Axboe Cc: linux-block@vger.kernel.org --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index e584673c18814..5becbafb84e8a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -224,7 +224,7 @@ static inline void bio_cnt_set(struct bio *bio, unsigned int count) { if (count != 1) { bio->bi_flags |= (1 << BIO_REFFED); - smp_mb__before_atomic(); + smp_mb(); } atomic_set(&bio->__bi_cnt, count); } -- 2.7.4