From patchwork Sun Aug 7 22:09:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12938335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4527FC19F2A for ; Sun, 7 Aug 2022 22:10:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E5BC8E0002; Sun, 7 Aug 2022 18:10:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 694ED8E0001; Sun, 7 Aug 2022 18:10:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 583E18E0002; Sun, 7 Aug 2022 18:10:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 487098E0001 for ; Sun, 7 Aug 2022 18:10:03 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D68AA80A26 for ; Sun, 7 Aug 2022 22:10:02 +0000 (UTC) X-FDA: 79774190244.01.E6E12BA Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 1EE9580165 for ; Sun, 7 Aug 2022 22:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=x4+1SyuBnrsfLH3HBApRgaK+TGzqaCKJHHZnZyL8QS8=; b=nu/cBWDS99rOTqn80qBNQjT8uK XOac2xWsTFDD6kBvHa9wYsprv1AqpHPZKL4PmsfGHE5hCfXSv/H8H2/teaAbY+TDBirmg9n1wxjOt 6PdTk8pOpKx963XwOBtwXdCEF/4LB6zLW4LEWT29np7gUmbCZy5XsE18f0XwWGyFjka9nVaKLAyQf lXghFir0KRS6W6jQBOwRu9XqavxA58iXNUINdo/muia/uZRyQ/jEiLzO/wZ7k6yCQaJcLxf4tza4y 3XHJG3eJKKEptiHDJTINiY8H4vKwk/7gtGxgrVrM8Yrj1kw6eopKjPQ5+wOImhQoVfu8+W6IO3HKs uBNZ2e8g==; Received: from [2601:1c0:6280:3f0::a6b3] (helo=casper.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKoSq-00DL2b-E7; Sun, 07 Aug 2022 22:09:40 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , Josh Triplett , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-api@vger.kernel.org, Andrew Morton , linux-mm@kvack.org Subject: [PATCH v2] kernel/sys_ni: add compat entry for fadvise64_64 Date: Sun, 7 Aug 2022 15:09:34 -0700 Message-Id: <20220807220934.5689-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="nu/cBWDS"; spf=none (imf02.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=rdunlap@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659910202; a=rsa-sha256; cv=none; b=XvRbgt6//BlOuOJmKDsIM7ujn+3djSbuHqi9HblKhtcm8kdLRQt/h9KccXCxDvypkZypHg urNqC3moZzTi2WK1fM6CUoILiYR9skAXnI0t+zYNePcXwf1g5vY/hEXaefPR3a/t3wQ8KX Ssh3coC5taMpo7hLAOLJfgXRaobqhbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659910202; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=x4+1SyuBnrsfLH3HBApRgaK+TGzqaCKJHHZnZyL8QS8=; b=S/CO9Ir3o8/sgNCa43DwpgZXe8YzRJJ+9lpkLVWJaWP1Zb7esw8DvDv0hBsL4DOab5K9qb BV+5DH6mDrjw+E/iYtLBvFDnTN/bfG2vdUWYLuv/mOLRodAGGQpkhXd2jD6ENHUnbj0/rY QgrcwG/8Wtj0aDXNwn7oCP69DYYgCFo= X-Stat-Signature: b8mjurniukex51q95h7xuwsd7emkqnww X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 1EE9580165 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="nu/cBWDS"; spf=none (imf02.hostedemail.com: domain of rdunlap@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=rdunlap@infradead.org; dmarc=none X-HE-Tag: 1659910201-255961 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When CONFIG_ADVISE_SYSCALLS is not set/enabled and CONFIG_COMPAT is set/enabled, the riscv compat_syscall_table references 'compat_sys_fadvise64_64', which is not defined: riscv64-linux-ld: arch/riscv/kernel/compat_syscall_table.o:(.rodata+0x6f8): undefined reference to `compat_sys_fadvise64_64' Add 'fadvise64_64' to kernel/sys_ni.c as a conditional COMPAT function so that when CONFIG_ADVISE_SYSCALLS is not set, there is a fallback function available. Fixes: d3ac21cacc24 ("mm: Support compiling out madvise and fadvise") Signed-off-by: Randy Dunlap Suggested-by: Arnd Bergmann Cc: Josh Triplett Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Cc: Arnd Bergmann Cc: linux-api@vger.kernel.org Cc: Andrew Morton Cc: linux-mm@kvack.org Reviewed-by: Arnd Bergmann Tested-by: Conor Dooley --- v2: patch kernel/sys_ni.c (for any arch) instead of arch/riscv's unistd.h (Arnd) kernel/sys_ni.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -277,6 +277,7 @@ COND_SYSCALL(landlock_restrict_self); /* mm/fadvise.c */ COND_SYSCALL(fadvise64_64); +COND_SYSCALL_COMPAT(fadvise64_64); /* mm/, CONFIG_MMU only */ COND_SYSCALL(swapon);