Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1252566rwe; Fri, 14 Apr 2023 17:35:19 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvKuUvx9RMmYGo61oDN7wgtd/CFW65zuu26zltpADNRrgIKnH7u/PzDCzE9TLOg0aHuk/T X-Received: by 2002:a17:903:120a:b0:1a6:3ffb:8997 with SMTP id l10-20020a170903120a00b001a63ffb8997mr5840643plh.42.1681518919193; Fri, 14 Apr 2023 17:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681518919; cv=none; d=google.com; s=arc-20160816; b=qcphYtH470QU1UakTXhoOC2GFBzHAohhFxRZHTgpHq2Vix1U2EQ+qc58zhQv1A/CvE 5KmyAYV9GHmROZW3fzxcHAlvSr4sXXIRwKgmueRe1mxMNG09OceLECsm1ARtZ1KalAzx QyoRlzHYfFltLjwNVK3tTrNCr3tUjkdO/z/Gb2lZJEI+3rt+thjgAgKJz9Gc6eR//pc5 mCTYohPAnfSf9QUkcx8gqCIzYdG8gNl1jq+fp+LSkXuZWnq+YFGONumOXDYKeA1hcSya VmOX7YEW/Gh/l1VHAw60cr9K1GjMHVqTrgAii61jRHxSmTziA3mGlfQzndwXsvlbKcYT 853w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=MQX/NFa0vuBqensH0VMNth+S72t6TIFu+0q1mZ4kLjc=; b=gQW1vIBz/PLK86edSypuL31E0UA4ExxOZg6qLXzXuKJEJLu3vKhAM/WlLVTrRbCkJr 5ZU288Fwt3LDnG6auS1mGT1eVU1xl4oJ6e865NQNhhbrCrlY23Z/LqXoWSi3HVtZ29dw AJIxMlurXBSexo4HcPopQcNz6OeVSzEFC0p02i8Re9yNkFvMVQigypj7Kh5dm6FmJVGR QcIs4+5p/85CsPPo5ulXb8KM20b8hKFSk9mrQose9Lt7HYqkZ7HJAgq86nVCnotiYDr/ bXlqODJRPHTKrkmC98JSs00qaX/jRqC1jhOpxSf6h43bJSKO9XbNiIXG4J7IM9GXIgsj 3Q1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a170902d90500b0019ce4e2be99si4727962plz.193.2023.04.14.17.35.07; Fri, 14 Apr 2023 17:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbjDOA2M (ORCPT + 99 others); Fri, 14 Apr 2023 20:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjDOA2L (ORCPT ); Fri, 14 Apr 2023 20:28:11 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB4893A96; Fri, 14 Apr 2023 17:28:09 -0700 (PDT) Received: from fsav412.sakura.ne.jp (fsav412.sakura.ne.jp [133.242.250.111]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 33F0Q4r1034541; Sat, 15 Apr 2023 09:26:04 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav412.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav412.sakura.ne.jp); Sat, 15 Apr 2023 09:26:04 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav412.sakura.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 33F0Pqw2034458 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sat, 15 Apr 2023 09:26:03 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: Date: Sat, 15 Apr 2023 09:25:51 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 3/7] mm/gup: remove vmas parameter from get_user_pages_remote() Content-Language: en-US To: Lorenzo Stoakes , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <5a4cf1ebf1c6cdfabbf2f5209facb0180dd20006.1681508038.git.lstoakes@gmail.com> From: Tetsuo Handa In-Reply-To: <5a4cf1ebf1c6cdfabbf2f5209facb0180dd20006.1681508038.git.lstoakes@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/04/15 8:27, Lorenzo Stoakes wrote: > diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c > index f5bcb0dc6267..74d8d4007dec 100644 > --- a/arch/arm64/kernel/mte.c > +++ b/arch/arm64/kernel/mte.c > @@ -437,8 +437,9 @@ static int __access_remote_tags(struct mm_struct *mm, unsigned long addr, > struct page *page = NULL; > > ret = get_user_pages_remote(mm, addr, 1, gup_flags, &page, > - &vma, NULL); > - if (ret <= 0) > + NULL); > + vma = vma_lookup(mm, addr); > + if (ret <= 0 || !vma) > break; This conversion looks wrong. When get_user_pages_remote(&page) returned > 0, put_page(page) is needed even if vma_lookup() returned NULL, isn't it?