From patchwork Thu May 3 13:50:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 134904 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1952658lji; Thu, 3 May 2018 06:51:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpskeNbBM3igOomZwkOcgc9xTxIXRdHp0m6ELRKz0s5vvzC53h1Z9vm4kAtuRccDMRSMV7q X-Received: by 2002:a63:7a07:: with SMTP id v7-v6mr19298532pgc.343.1525355463029; Thu, 03 May 2018 06:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525355463; cv=none; d=google.com; s=arc-20160816; b=qbWXOxBfm2jmRURky0noqLQ3QSWialDHEWE0ONXwaVt1zV6De7xS5ld0+dIs6wbmmf 2p7fikfqRaXJV8UplDQvmAeVIC9AtEDcM5yLs/LuULt98hJKbAB9t66xLYrzKorkDtJ9 OMDYpfwo7UzgJec2i+70tnEdGEpSFqfOmrBkDTs5LBMZa2Sj2jnpW9YlBMS1Bt+BlZ9b u7RXVsHWdgl/v7lLHkeLWhDompKUNHZtCOCcjkj6LxUeDyIBWJp8x/O6cz0IBsc3vkX/ 5WqkFsONwDx9zQIbJrvtkXRnoiQoSLYeGvNdNWiyc6g55vCVDmhAx2LGrUFL5K9qIcvI o+sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=zvquGQih937GY5ZJ5CyTUt9YRVtQ08R4oMzo5mrf07c=; b=gkG1LyrInE7HXcz6f2+Nl/pe68MoIk2cWY7wFdeJJTaGAmyknPaf9DeogYF6EfkjF4 sHzjniaMzocdqMMLFmsbad8fBjx7hu9EmV034uL8Kr9WHvfjEu0C/Md6D1rp87RI8yL3 /Jm3U3w5VjAJ8QcXx7xvYImop/C+wqJFDn1n3bueTr1R69zwPSTC6Hrk8JbrUkF59hID XejsG7RJTtuiHG5kkQnerjgfv7tAi/EB0+QBdr/f4Pksud22QXsfp3KAf4O+mlvQ/pg5 eespVekr9grYd7MsxLmEUtOfYjyeAQDsUDW4XUHVogNZpSSiw0w0eOi5rNxmrNgmzalN jIpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 e9-v6si13934251pln.72.2018.05.03.06.51.02; Thu, 03 May 2018 06:51:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287AbeECNu7 (ORCPT + 9 others); Thu, 3 May 2018 09:50:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42328 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbeECNu6 (ORCPT ); Thu, 3 May 2018 09:50:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EFC811435; Thu, 3 May 2018 06:50:57 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5418A3F25D; Thu, 3 May 2018 06:50:56 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: Mark Rutland , Trond Myklebust , Anna Schumaker , "J . Bruce Fields" , Jeff Layton , "David S . Miller" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND] SUNRPC: fix include for cmpxchg_relaxed() Date: Thu, 3 May 2018 14:50:50 +0100 Message-Id: <20180503135050.15778-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently net/sunrpc/xprtmultipath.c is the only file outside of arch/ headers and asm-generic/ headers to include , apparently for the use of cmpxchg_relaxed(). However, many architectures do not provide cmpxchg_relaxed() in their , and it is necessary to include to get this definition, as noted in Documentation/core-api/atomic_ops.rst: If someone wants to use xchg(), cmpxchg() and their variants, linux/atomic.h should be included rather than asm/cmpxchg.h, unless the code is in arch/* and can take care of itself. Evidently we're getting the right header this via some transitive include today, but this isn't something we can/should rely upon, especially with ongoing rework of the atomic headers for KASAN instrumentation. Let's fix the code to include , avoiding fragility. Signed-off-by: Mark Rutland Cc: Trond Myklebust Cc: Anna Schumaker Cc: J. Bruce Fields Cc: Jeff Layton Cc: David S. Miller Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org --- net/sunrpc/xprtmultipath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) I sent this about a year ago [1], but got no response. This still applies atop of v4.17-rc3. I'm currently trying to implement instrumented atomics for arm64, and it would be great to have this fixed. Mark. [1] https://lkml.kernel.org/r/1489574142-20856-1-git-send-email-mark.rutland@arm.com -- 2.11.0 diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c index e2d64c7138c3..d897f41be244 100644 --- a/net/sunrpc/xprtmultipath.c +++ b/net/sunrpc/xprtmultipath.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include