Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp6905ima; Thu, 25 Oct 2018 14:22:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5fktw3FYmizFjIfjfYQudi3cus3dejHAQLm98eBGGF5mwBcSW2m2IEg+zgF+vUFH5kPRt+h X-Received: by 2002:a17:902:9047:: with SMTP id w7-v6mr798560plz.4.1540502520477; Thu, 25 Oct 2018 14:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540502520; cv=none; d=google.com; s=arc-20160816; b=cf6Ecw+VLwYjorkrcky76e757GTHBoLOcb+xww16kkf1UzW4nw9oRBcHQ6k3+K14ws KSr/zYrMnKGX1ERgUko2ZmHLMbSYIPKuEtZTvOkGejhCKWRkkWhfsb1Brx2wdpkxC8EF 6DB95bjg9ukPNrSiNVy6WyTSGLsE7LVyVe1AJz/3abKxJ3JqfPMljSq164/OITFOcEh3 dh1RZKTOGgWN6nNqgZMb0SK2baW869qPW10PA5xplRL3vX2Ch+pJcbLFOHU/PNN75ehW oZSHYz0qlHVfqtvibHwN41X66OBSYa4O/o9fz7XVPU90tEnSzmIPdwJ2V4CX5ZSaUMTt MI6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=O0xLKvkS57ApuPCnSmwFrvRxS/Ryg/owy5LT6XV2XGI=; b=ChUmlJauDIAIO9nuhoEmuPvR3PETyD4tnfrv4cZ36haf9j43lTfJhSHCyTg3mG/0iJ 3rzWsI016Q7tVUnVd46CMgnQC8oDMDwQ2yGF8KVdJjUD8XwiGH76mKrF9svEJFAHlq8c xe048i/qvwyksqcQd2NnXjT9Dj8MhXck8HlnI/A9b5xAr8CdK5KHyYRgkD3onHkDvyJE MJCsNTyRIe/W2upzyiAq0cqVDPrukB4FwMwGOXdvUF1uGqcMyCZgfaUQUSYZCgVUN+iY 3hNBxt94tYTQ6kREP7zUdjVrtoSVj0jkDgQlJaWiaF3oJyCQAuOh2e6PdZBeuCPIBl4a yJLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OQtc2wGd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7-v6si9002327pgn.108.2018.10.25.14.21.41; Thu, 25 Oct 2018 14:22:00 -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=@gmail.com header.s=20161025 header.b=OQtc2wGd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbeJZFxt (ORCPT + 99 others); Fri, 26 Oct 2018 01:53:49 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38889 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbeJZFxt (ORCPT ); Fri, 26 Oct 2018 01:53:49 -0400 Received: by mail-wm1-f68.google.com with SMTP id b14-v6so2871544wmj.3 for ; Thu, 25 Oct 2018 14:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O0xLKvkS57ApuPCnSmwFrvRxS/Ryg/owy5LT6XV2XGI=; b=OQtc2wGdKX8SsLO6ukEofwSC1cL0Uosy0zWRRpCNTWM+p5h3XGF1qss5juG4FmLoCR clejaqyRnsV3kN6951WwA+eHvFAlaki9IAGndDf7jJxugcL85mjO8D+8xuW3Y5Sf92Ed X6Ugb4LLMLP/uG2mD0Cnvlh8EcANOmeVxp4LW1znyaPMn8QWX7iJCtTqJw5OUJApq1g7 u77wNllnuoxp/sk6j6p6yAZG8evgXaXpNLBiQvk9DK5A5TgWmZ5HlQ4MM2S3T8n8ywlJ 8/cav3b8klh9x0xcMuioFA/slKzclggfiygCeekbBBT14KfAeCG56kVe67pbFLRcZa7B U7EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=O0xLKvkS57ApuPCnSmwFrvRxS/Ryg/owy5LT6XV2XGI=; b=JGh1JBkK73NFjaTZqrPwQCfp5AMZzmt/DdlxT+DKTw9187wiIaVV73nxMexxsBZ0n9 GGLoklwGM7bwYXI0yWjNfvRC/1H6Esjjw5taKjVU9j+Fy3C3eFS8FPJ4wEh3ENt9rd1D i8pozAHDcqt+4aHLLOMmsntTVtEA/ZE8uoKfQVUt4fcc5hMjQakwRn8g0jhygAMa8ncZ ZCwRzjaUycnICmAl06vNqZUCq437SRYbt/MWHtin3AANPw1S0FjWizbJwrnkhZS85EDj hpQb9B2M8sozwaDibgOq8PSDEpU6MVl6QMtsJ4rrCyVhka84L+oXrbwik1qWIocNdqvq ic4Q== X-Gm-Message-State: AGRZ1gLLDMPEyZl5P3L3xw5bNwKPj2Tq/fxrZXkedBh6NkarzvOnias1 FrfkRWbTJRSRNg6xKV1DauI= X-Received: by 2002:a1c:f312:: with SMTP id q18-v6mr3271983wmq.14.1540502368455; Thu, 25 Oct 2018 14:19:28 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id 4-v6sm1424254wmt.16.2018.10.25.14.19.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Oct 2018 14:19:27 -0700 (PDT) Date: Thu, 25 Oct 2018 14:19:25 -0700 From: Nathan Chancellor To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Nick Desaulniers , Boaz Harrosh Subject: Re: [PATCH] fs/exofs: Remove ignored __weak attribute Message-ID: <20181025211925.GA24709@flashbox> References: <20180930205126.25840-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180930205126.25840-1-natechancellor@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 30, 2018 at 01:51:26PM -0700, Nathan Chancellor wrote: > Clang warns that the __weak attribute is going to be ignored on > g_attr_inode_data because it's not in the correct location (needs to be > after the type). > > In file included from fs/exofs/dir.c:35: > In file included from fs/exofs/exofs.h:41: > fs/exofs/common.h:186:21: warning: 'weak' attribute only applies to > variables, functions, and classes [-Wignored-attributes] > static const struct __weak osd_attr g_attr_inode_data = ATTR_DEF( > ^ > > Turns out that GCC ignores the attribute too albeit silently because > moving the attribute after either osd_attr or g_attr_inode_data like > all other uses of __weak on variables in the kernel causes a build > error on both GCC and Clang because static variables cannot be weak > since weak definitions rely on not having internal linkage: > > In file included from fs/exofs/namei.c:34: > In file included from fs/exofs/exofs.h:41: > fs/exofs/common.h:186:30: error: weak declaration cannot have internal > linkage > static const struct osd_attr __weak g_attr_inode_data = ATTR_DEF( > ^ > > Just remove the attribute because it hasn't been correct since the > initial addition of this file in commit b14f8ab28449 ("exofs: Kbuild, > Headers and osd utils"). > > Reported-by: Nick Desaulniers > Reviewed-by: Nick Desaulniers > Signed-off-by: Nathan Chancellor > --- > fs/exofs/common.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/exofs/common.h b/fs/exofs/common.h > index 7d88ef566213..45da96a1528d 100644 > --- a/fs/exofs/common.h > +++ b/fs/exofs/common.h > @@ -183,7 +183,7 @@ struct exofs_fcb { > #define EXOFS_INO_ATTR_SIZE sizeof(struct exofs_fcb) > > /* This is the Attribute the fcb is stored in */ > -static const struct __weak osd_attr g_attr_inode_data = ATTR_DEF( > +static const struct osd_attr g_attr_inode_data = ATTR_DEF( > EXOFS_APAGE_FS_DATA, > EXOFS_ATTR_INODE_DATA, > EXOFS_INO_ATTR_SIZE); > -- > 2.19.0 > Hi Andrew, Can you take this with Boaz's ack? Thanks, Nathan