Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp943152imd; Sat, 3 Nov 2018 13:46:36 -0700 (PDT) X-Google-Smtp-Source: AJdET5ckw+C/Kee1wsc81CByYGYIYWT3AcsR2FD9+meDchWxPixV/3nMD3J7LwZwIYJeWtJYiP8d X-Received: by 2002:a63:1e5c:: with SMTP id p28mr15271862pgm.376.1541277996297; Sat, 03 Nov 2018 13:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541277996; cv=none; d=google.com; s=arc-20160816; b=RykAKMojK0NYArhH25XWkKE90wuVLQtV/HQD4zzXKoQKzxWwbkiCwJfP5uqJy2oZdr yjo0YOX57nySWJcJmJMv1BfHGwZ1Iru4uq7vrW46qfHdKJP+QGLkPvcww5DVlS72WyJ2 qO0lwtkrVt6g2a6PvmrcLiyamOQ26DLWDer2Q9Xae+ez/PSMgWlHxedAsf/C9TsV+APs 2vOqjxw+lIN+xJHrbHPVWh69Fze2ZfB6iZg2ZC3iUxYbbyex5dVKdIb5/Hl1duzknHPV 0D8JCB2b23hoZ3dLXEifvIdtirHtAuXu6+k9hv6LqXnhkBeJxA+6+D2NXwD8A2GSLodl 5yZA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=AUnEVff6elLR9sAjJY0qrl2pnNvZYJygUTDPnrNfrwA=; b=Fbmev33exD8B83UPKwajMRJgRDrv+9yxFoVjs3HPmhbxs8y+rZDhgZdtm3NhK5uXQQ CoYwLetnfZALtpDaNi0iapzRVLlV+KVb2RjPs+OkoQOUKRoIBVj0PB9dYLSZSMP+m9eG w4WXpurKdETbu6WvxLyz+VGP1hP8/dEr2NGhn/s1iNACYIW7mMmwhF3kSYyeVb4f0XWz NYTKnNeplFBWednorKluB2XoeAmz6ogKqjquK0MECwDqNSmmLKfXgl+w8UhIzgwJwDOy A/7b8GAuPeB3fevxT7xEtM8MC7RQw590PRSTcvbvh+CL7zXQ0Dqf3jc2PnGpot+BI0jL Zwlg== ARC-Authentication-Results: i=1; mx.google.com; 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 16-v6si29276606pfy.64.2018.11.03.13.46.07; Sat, 03 Nov 2018 13:46:36 -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; 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 S1727066AbeKDFyF (ORCPT + 99 others); Sun, 4 Nov 2018 01:54:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:54358 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726622AbeKDFyF (ORCPT ); Sun, 4 Nov 2018 01:54:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A5D02ADBC; Sat, 3 Nov 2018 20:41:39 +0000 (UTC) Subject: Re: [PATCH] btrfs: avoid link error with CONFIG_NO_AUTO_INLINE To: Arnd Bergmann , Chris Mason , Josef Bacik , David Sterba Cc: Changbin Du , Anand Jain , Misono Tomohiro , Qu Wenruo , Gu Jinxiang , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181103153941.1881966-1-arnd@arndb.de> From: Nikolay Borisov Openpgp: preference=signencrypt Autocrypt: addr=nborisov@suse.com; prefer-encrypt=mutual; keydata=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7Oqe/3Cirs5 KhaXBcMmJR1qo8QH8eYZ+qhFE3bSPH446+5oEw8A9v5oonKV7zMAEQEAAcLBXwQYAQIACQUC WIoHPgIbDAAKCRBxvoJG5T8oV1pyD/4zdXdOL0lhkSIjJWGqz7Idvo0wjVHSSQCbOwZDWNTN JBTP0BUxHpPu/Z8gRNNP9/k6i63T4eL1xjy4umTwJaej1X15H8Hsh+zakADyWHadbjcUXCkg OJK4NsfqhMuaIYIHbToi9K5pAKnV953xTrK6oYVyd/Rmkmb+wgsbYQJ0Ur1Ficwhp6qU1CaJ mJwFjaWaVgUERoxcejL4ruds66LM9Z1Qqgoer62ZneID6ovmzpCWbi2sfbz98+kW46aA/w8r 7sulgs1KXWhBSv5aWqKU8C4twKjlV2XsztUUsyrjHFj91j31pnHRklBgXHTD/pSRsN0UvM26 lPs0g3ryVlG5wiZ9+JbI3sKMfbdfdOeLxtL25ujs443rw1s/PVghphoeadVAKMPINeRCgoJH zZV/2Z/myWPRWWl/79amy/9MfxffZqO9rfugRBORY0ywPHLDdo9Kmzoxoxp9w3uTrTLZaT9M KIuxEcV8wcVjr+Wr9zRl06waOCkgrQbTPp631hToxo+4rA1jiQF2M80HAet65ytBVR2pFGZF zGYYLqiG+mpUZ+FPjxk9kpkRYz61mTLSY7tuFljExfJWMGfgSg1OxfLV631jV1TcdUnx+h3l Sqs2vMhAVt14zT8mpIuu2VNxcontxgVr1kzYA/tQg32fVRbGr449j1gw57BV9i0vww== Message-ID: <8e3a668d-79d2-6fc0-6291-b3d19b793d6f@suse.com> Date: Sat, 3 Nov 2018 22:41:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181103153941.1881966-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3.11.18 г. 17:39 ч., Arnd Bergmann wrote: > On 32-bit ARM with gcc-8, I see a link error with the addition of the > CONFIG_NO_AUTO_INLINE option: > > fs/btrfs/super.o: In function `btrfs_statfs': > super.c:(.text+0x67b8): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x67fc): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x6858): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x6920): undefined reference to `__aeabi_uldivmod' > super.c:(.text+0x693c): undefined reference to `__aeabi_uldivmod' > fs/btrfs/super.o:super.c:(.text+0x6958): more undefined references to `__aeabi_uldivmod' follow > > So far this is the only file that shows the behavior, so I'd propose > to just work around it by marking the functions as 'static inline' > that normally get inlined here. > > The reference to __aeabi_uldivmod comes from a div_u64() which has an > optimization for a constant division that uses a straight '/' operator > when the result should be known to the compiler. My interpretation is > that as we turn off inlining, gcc still expects the result to be constant > but fails to use that constant value. I read this as "this is a compiler bug", no ? So you are providing a hack around a compiler bug? > > Cc: Changbin Du > Fixes: 943b8435c3bd ("kernel hacking: add a config option to disable compiler auto-inlining") > Signed-off-by: Arnd Bergmann > --- > fs/btrfs/super.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c > index c3c1e7bee49d..b7af0b8936ad 100644 > --- a/fs/btrfs/super.c > +++ b/fs/btrfs/super.c > @@ -1922,7 +1922,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, > } > > /* Used to sort the devices by max_avail(descending sort) */ > -static int btrfs_cmp_device_free_bytes(const void *dev_info1, > +static inline int btrfs_cmp_device_free_bytes(const void *dev_info1, > const void *dev_info2) > { > if (((struct btrfs_device_info *)dev_info1)->max_avail > > @@ -1951,8 +1951,8 @@ static inline void btrfs_descending_sort_devices( > * The helper to calc the free space on the devices that can be used to store > * file data. > */ > -static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, > - u64 *free_bytes) > +static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, > + u64 *free_bytes) > { > struct btrfs_device_info *devices_info; > struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; >