From patchwork Wed Nov 27 20:31:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 180324 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp6638084ilf; Wed, 27 Nov 2019 12:51:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwFcOeWpFsvz1a9wCLzQjaDfUEFrlqD0tVEBbdhozf21h7DAzMZCK0KH7NAeuKxeSjXvV1V X-Received: by 2002:aa7:cac7:: with SMTP id l7mr34545488edt.196.1574887896147; Wed, 27 Nov 2019 12:51:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887896; cv=none; d=google.com; s=arc-20160816; b=ghDPfafPOWzwgxtNMVfBYkGW54GJi4CbwVQXrC5ws9E7/wzbjxVnLQWwzyB9aQS7DH QdWk3EoVIIOgu1A4CJdh4QX4FSl8t/wLArXYPKlQtqeAlJfztzFCl67Upf2lRp4eqFhp nhtvSghr+KZtDoq0pspTv62PHQ3uAx+tXjmYGwZHgUcYCYwxe9cc7/29rE2s2o0Djel0 qECKjhgDURK6kd+/E6tZLTtF/cpqx15zEAc3zcmQ8wZomA3TthUNQ51jBicPFrcDGYlV H+U4QwBJhZISUwisDeT5D0+69Wd5ZVesmHp19Jh93LswONQeXi6K5/Sk24HIpiDNMxP5 Kgtw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MF7EUjgkLxFmiuZkCElusTmEkiOe6yQYYugLOR//FKQ=; b=C33tORx27pgFIziA3DWj+ckXuU/mIV0Jxz5J2dnowQb8MAIGHcIIEjYMOcSovceBOJ aEIPGi7Eb49ji0tlvAxSxdADOJfV1cMAxdZ/wBElv0l1uEQQDHrbO7wxP6YRhHpKpdfx RcojEzdN8l822gI//x878KhEVbJvAF6kizoVAJa9uso8i185qI09PpBEsLgh3CNo2/jJ 7gntHo/wbtUjtuYXKou3iagyEbrEK1gNqxmOLP/ZhH0dLRpAYw9rEk+AgW8cpIO6hN+d 2GZpo4brej/BCIw9eHQsvBJZnnqsvlGTHrPUJXEFOmJ2WCOZaawT5uw4RLIWyXwOBgIZ R6tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zNGSA3f6; 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 p92si12059751edd.407.2019.11.27.12.51.35; Wed, 27 Nov 2019 12:51:36 -0800 (PST) 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=@kernel.org header.s=default header.b=zNGSA3f6; 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 S1730498AbfK0Uvd (ORCPT + 26 others); Wed, 27 Nov 2019 15:51:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:38258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730490AbfK0Uva (ORCPT ); Wed, 27 Nov 2019 15:51:30 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 610682084D; Wed, 27 Nov 2019 20:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887889; bh=e0kwQxqjl/q5q36XpJycaaUijSZMetJRcSRLw0P4rkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zNGSA3f6nTzl6qLfsC/XwtWchdVBvyBusLhvqYLM6ZZ+Wb5+MUkrfYHuqe+PNEVnR 0Jw1lvaIixoQrgOAKW5hHpqKJR+pw46qCAgDnOP46jOFTwHsMX0fiU+fzaVoiMb0Vf Er9j6S/5OH70e+pxOAapIIHOHwWcQIgGXBZLDhS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Borisov , Changbin Du , Arnd Bergmann , David Sterba , Sasha Levin Subject: [PATCH 4.14 132/211] btrfs: avoid link error with CONFIG_NO_AUTO_INLINE Date: Wed, 27 Nov 2019 21:31:05 +0100 Message-Id: <20191127203106.519625908@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 7e17916b35797396f681a3270245fd29c1e4c250 ] Note: this patch fixes a problem in a feature outside of btrfs ("kernel hacking: add a config option to disable compiler auto-inlining") and is applied ahead of time due to cross-subsystem dependencies. 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. Link: https://lkml.kernel.org/r/20181103153941.1881966-1-arnd@arndb.de Reviewed-by: Nikolay Borisov Reviewed-by: Changbin Du Signed-off-by: Arnd Bergmann [ add the note ] Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 49a02bf091aea..204d585e012a8 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1863,7 +1863,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) } /* 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 > @@ -1892,8 +1892,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;