From patchwork Mon Feb 17 05:03:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 11385241 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38B78139A for ; Mon, 17 Feb 2020 05:04:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 18E5F2070B for ; Mon, 17 Feb 2020 05:04:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18E5F2070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9797D6B000C; Mon, 17 Feb 2020 00:04:32 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8D56A6B000D; Mon, 17 Feb 2020 00:04:32 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C50E6B000E; Mon, 17 Feb 2020 00:04:32 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 63CC46B000C for ; Mon, 17 Feb 2020 00:04:32 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id ECA8E180AD811 for ; Mon, 17 Feb 2020 05:04:31 +0000 (UTC) X-FDA: 76498428342.14.soup80_7eda5ea00091b X-Spam-Summary: 2,0,0,d5e1640aedb04e5b,d41d8cd98f00b204,anshuman.khandual@arm.com,::linux-kernel@vger.kernel.org:anshuman.khandual@arm.com:akpm@linux-foundation.org,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1345:1359:1431:1437:1534:1540:1711:1714:1730:1747:1777:1792:1963:2393:2559:2562:3138:3139:3140:3141:3142:3351:3872:3876:4321:5007:6261:8634:10004:11026:11658:11914:12297:12555:12895:13069:13255:13311:13357:13846:14096:14181:14384:14394:14721:21080:21451:21627:21990:30054,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: soup80_7eda5ea00091b X-Filterd-Recvd-Size: 2023 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Feb 2020 05:04:31 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2E4E511D4; Sun, 16 Feb 2020 21:04:31 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.16.95]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B28FC3F703; Sun, 16 Feb 2020 21:04:29 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Anshuman Khandual , Andrew Morton Subject: [PATCH 5/5] mm/vma: Replace all remaining open encodings with vma_is_anonymous() Date: Mon, 17 Feb 2020 10:33:53 +0530 Message-Id: <1581915833-21984-6-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581915833-21984-1-git-send-email-anshuman.khandual@arm.com> References: <1581915833-21984-1-git-send-email-anshuman.khandual@arm.com> 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: This replaces all remaining open encodings with vma_is_anonymous(). Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- mm/gup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index c8ffe2e61f03..58c8cbfeded6 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -146,7 +146,8 @@ static struct page *no_page_table(struct vm_area_struct *vma, * But we can only make this optimization where a hole would surely * be zero-filled if handle_mm_fault() actually did handle it. */ - if ((flags & FOLL_DUMP) && (!vma->vm_ops || !vma->vm_ops->fault)) + if ((flags & FOLL_DUMP) && + (vma_is_anonymous(vma) || !vma->vm_ops->fault)) return ERR_PTR(-EFAULT); return NULL; }