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: 908054 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40cGkv5jRsz9s3q for ; Thu, 3 May 2018 23:51:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287AbeECNu7 (ORCPT ); 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 Reviewed-by: Jeff Layton --- 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 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