Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4445831pxf; Tue, 16 Mar 2021 13:46:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys6Wbzz6/pg5oW/XMuFDj/BvgbVNHg4M30KQUcIThhwd160bllcsgctHbfFdf1dp/t97a8 X-Received: by 2002:a50:cf48:: with SMTP id d8mr39656983edk.54.1615927576782; Tue, 16 Mar 2021 13:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615927576; cv=none; d=google.com; s=arc-20160816; b=0UUM140PCBxZreoukcEXejIaZxRFszO59m3dOZo7B4uqFkHhUH3mnz0A+AUOGVuybL f0HAKK/Kg9NHr5pYyCCghvqgA/2QOyK87qq7t+Ka6By/JEBYKE6i3R9gZZSpFodrWS5A Q5K6eqNvFIvypzGkGHSVZwp7m5kWM54xuSTFPXuS5YmpJRphQ6mvzEnVxLhuDOwM6sv9 ZThbU4lod2NJf7ET9FY3VGmgUkpeRv9SyairYvoLNxnQ4CYmZ914O2n1FJtnOKOkf+Ck xlKHdUIQ1yulOjKDxDqL8cImKb6ZovkC7n2u1MJ6YKuiwo0PLgm+8O3zIWj63gIhF01M BcRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KqzASXGhrTuQ3KDFC8H+v0fbPkS9czuEH52WiGTsxDU=; b=s6YsV+GSIaahikCqUTbCAaBUpr14MXfa5sQuq5fy7M/RZfCuAarvF8PspRELfpBCBu 98SXZ44vYnQNmedRCmRFzpxLB7L1WH3F4o0nGarQwqYXUkq0jfOWBGAJWILOSEXqXdsE MgNy34WnIeEgxGIj01Ny6Vs0larng03u3Z5Nttd/FmAzwA00TkfmPs3J2hnlhjLe2bSE WFISNuUdw7QyM1THE5y9mNW8Z6zqEmgGlTNCzfKyiIyGHXXULR3NfsL5tEJ2vvMZVJHI ZLTj0vFOQerv5XOXGZ1oiUnUWRTvBzjq/qjLkFXCwGpiWmGSOzrGNEUYHrmc0w5zkHZ2 7aOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=lcGNSFbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs37si2704002ejc.198.2021.03.16.13.45.53; Tue, 16 Mar 2021 13:46:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=lcGNSFbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234065AbhCPPkO (ORCPT + 99 others); Tue, 16 Mar 2021 11:40:14 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:52656 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbhCPPkA (ORCPT ); Tue, 16 Mar 2021 11:40:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1615909201; x=1647445201; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=KqzASXGhrTuQ3KDFC8H+v0fbPkS9czuEH52WiGTsxDU=; b=lcGNSFbl+vPjuht6ALtz3D3bUg/G0DZBAlLicWe+SeV96+8/en9+4Mq0 XHXjrfoNF5T9lc8vhsF8Xx6sS2lH6NDs1hlqYLeeZypzIyMvjNk8MjgsY 4kiCYkmFesGYGA9ehTVOrLpSGWkRIw1TXyHXr2lFn33X8UFx/Rx4Os50U Y=; X-IronPort-AV: E=Sophos;i="5.81,251,1610409600"; d="scan'208";a="120908366" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 16 Mar 2021 15:39:54 +0000 Received: from EX13D31EUA001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1a-67b371d8.us-east-1.amazon.com (Postfix) with ESMTPS id 15EF9A1EC3; Tue, 16 Mar 2021 15:39:51 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.162.213) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Mar 2021 15:39:47 +0000 From: SeongJae Park To: CC: , , , , , SeongJae Park Subject: [PATCH v2] mm/shmem: Enclose shmem_mcopy_atomic_pte() with 'CONFIG_USERFAULTFD' Date: Tue, 16 Mar 2021 16:39:30 +0100 Message-ID: <20210316153930.29827-1-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210316094910.23827-1-sjpark@amazon.com> References: <20210316094910.23827-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.213] X-ClientProxiedBy: EX13D40UWA003.ant.amazon.com (10.43.160.29) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park Commit 49eeab03fa0a ("userfaultfd: support minor fault handling for shmem") introduced shmem_mcopy_atomic_pte(). The function is declared in 'userfaultfd_k.h' when 'CONFIG_USERFAULTFD' is defined, and defined as 'BUG()' if the config is unset. However, the definition of the function in 'shmem.c' is not protected by the '#ifdef' macro. As a result, the build fails when the config is not set. This commit fixes the problem. Fixes: 49eeab03fa0a ("userfaultfd: support minor fault handling for shmem") Signed-off-by: SeongJae Park --- Changes from v1 - Remove unnecessary internal code review URL --- mm/shmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/shmem.c b/mm/shmem.c index 547df2b766f7..c0d3abefeb3f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2359,6 +2359,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode return inode; } +#ifdef CONFIG_USERFAULTFD int shmem_mcopy_atomic_pte(struct mm_struct *dst_mm, pmd_t *dst_pmd, struct vm_area_struct *dst_vma, unsigned long dst_addr, unsigned long src_addr, @@ -2492,6 +2493,7 @@ int shmem_mcopy_atomic_pte(struct mm_struct *dst_mm, pmd_t *dst_pmd, shmem_inode_unacct_blocks(inode, 1); goto out; } +#endif #ifdef CONFIG_TMPFS static const struct inode_operations shmem_symlink_inode_operations; -- 2.17.1 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879