Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp190694imp; Tue, 19 Feb 2019 21:31:35 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib5T5sSf26yOVokE5O4pyiI/qydq3TSGcaRx0ZELLR9tbH47kzUoOPzY4itZhXMc9Rs4x49 X-Received: by 2002:a62:5444:: with SMTP id i65mr33960006pfb.193.1550640695871; Tue, 19 Feb 2019 21:31:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550640695; cv=none; d=google.com; s=arc-20160816; b=hc5dpff2gn93OY1j5B7sjiONHoBz+141oe6puQjuLUBs7n4GbvIaFU5n4dCO0kDM+b shjR1KT1E0JtXpFw2RaO1ur4EPZ1TGVUxYmVmqjI8wou3rAgSz9JZ1Mg51j5I4TyYE/U PHDoJthXKz/gEia0J8okqGR4EHMfJPz3Csq8UgI/BrmRPnUrx5hC2o8Y0GtO48Lg74YU t45n0sg/g2biNyxp0vXLBADv4x08d/Dqlk/v6hOdxFce37EQzVmFAkQyAptU7+WsDV3w OPnmP9fHDE/XyP8JhuyW7XMsY2f39XzYfhSMU9XkAJSihrGwVfv24J1FOfkFHfJslaDR 88Jw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NxuweNm4GxL/BoOqBVX9oI0qswOBhm+J5hpwG3wNYwI=; b=J1zxGk/K8vKYlVdairmoAn2nss4xdiysFGzacw+pZosHL52Sy4NrUXdJNEHP7wQ6YC D+hZeOhrfcEXJyJ5sPe/yAKgPCXm9uli4lLo1QEqtfm87YLHPgNrxCiL9NY2GgaeMJz0 D8U/4m0+LRiXjBanx3Vca++KwEbj1ptYnrXc729X9EZpGjEkvsTh3hYidwQNZj9fj4Sx gabUn50tZkv0xkyqUAOGwdhZJiTliDk6A8k2sCO3lzFb33HBdOBgkHBL+8r+Ent+w7Xj NoY29Muyz8bbe8/gEqhgMgIw5RlKviAP6rXm42plRJmiJaZyjVAfK73ave53eiibF71W m67Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r63si10818287plb.148.2019.02.19.21.31.20; Tue, 19 Feb 2019 21:31:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730488AbfBTFay (ORCPT + 99 others); Wed, 20 Feb 2019 00:30:54 -0500 Received: from mga11.intel.com ([192.55.52.93]:42355 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbfBTFav (ORCPT ); Wed, 20 Feb 2019 00:30:51 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 21:30:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,388,1544515200"; d="scan'208";a="144924916" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2019 21:30:50 -0800 From: ira.weiny@intel.com To: John Hubbard , Andrew Morton , Michal Hocko , "Kirill A. Shutemov" , Peter Zijlstra , Jason Gunthorpe , Benjamin Herrenschmidt , Paul Mackerras , "David S. Miller" , Martin Schwidefsky , Heiko Carstens , Rich Felker , Yoshinori Sato , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Ralf Baechle , Paul Burton , James Hogan Cc: Ira Weiny , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-fpga@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-scsi@vger.kernel.org, devel@driverdev.osuosl.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-fbdev@vger.kernel.org, xen-devel@lists.xenproject.org, devel@lists.orangefs.org, ceph-devel@vger.kernel.org, rds-devel@oss.oracle.com Subject: [RESEND PATCH 5/7] IB/hfi1: Use the new FOLL_LONGTERM flag to get_user_pages_fast() Date: Tue, 19 Feb 2019 21:30:38 -0800 Message-Id: <20190220053040.10831-6-ira.weiny@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190220053040.10831-1-ira.weiny@intel.com> References: <20190220053040.10831-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ira Weiny Use the new FOLL_LONGTERM to get_user_pages_fast() to protect against FS DAX pages being mapped. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/hfi1/user_pages.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/user_pages.c b/drivers/infiniband/hw/hfi1/user_pages.c index 78ccacaf97d0..6a7f9cd5a94e 100644 --- a/drivers/infiniband/hw/hfi1/user_pages.c +++ b/drivers/infiniband/hw/hfi1/user_pages.c @@ -104,9 +104,11 @@ int hfi1_acquire_user_pages(struct mm_struct *mm, unsigned long vaddr, size_t np bool writable, struct page **pages) { int ret; + unsigned int gup_flags = writable ? FOLL_WRITE : 0; - ret = get_user_pages_fast(vaddr, npages, writable ? FOLL_WRITE : 0, - pages); + gup_flags |= FOLL_LONGTERM; + + ret = get_user_pages_fast(vaddr, npages, gup_flags, pages); if (ret < 0) return ret; -- 2.20.1