From patchwork Thu Aug 22 07:13:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13772867 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A3A0C531DF for ; Thu, 22 Aug 2024 07:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jnbwyZ8nm7OA7xAj7wrWrabgK1t5zgYyH3DelQTt/t4=; b=QbS0gR+5p3kcu9k1X2H6rHlSAw Z9/j5fleRENDyJRSo46MPGHrAPVlTn5qXQLJ8Caq+ebU/fkf02oIiuBV5/Eg4k0hS/jMNuQdeuFKQ rQTA9aMLKKsKwazskTjDqVdkIgaL5B+RqNCvp3L7IqsdBAoYN+TyAIlfXnmONmQNAwtxZV7acVGka aQvUnSxI/C+OyPAtNbYV9qi5LvaSsoZANoBImdhjZcj2JIni5Wr/jjs8t7q/Iime2C7nbTu5XtW6y qQD5wRVsTkGFkJ+f3TT5Ecleo33e4WWjmTSbLhzgjh02TLphFJKfiSulLxBQ7QBoODSvXc1zPRk5d 9JF0vQHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh24G-0000000BoWh-2HwN; Thu, 22 Aug 2024 07:17:12 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh21M-0000000BmwQ-1wNY for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 07:14:13 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-71430e7eaf8so391869b3a.1 for ; Thu, 22 Aug 2024 00:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724310851; x=1724915651; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jnbwyZ8nm7OA7xAj7wrWrabgK1t5zgYyH3DelQTt/t4=; b=CSliaIDXDQ0LxAysN3lnowwcw8sWpTj8ai9KsxyM635XDDZl12WdGgG+obuZdVhQvU DEe06+tO86bosrQxA95z6uPnjGsCkLvfC0e1HiaBo1Y3uNY4ZD/UT2eR2dSpr36R3fgA tRllcR7nLpeoJ00AHbE0WgxMN99h+myp0EUjZ01OPAaoUDi2akAdaVrqK1vxoo+Q+O+b sBZiQSyfYCn0oXWK+0BTb8rNoRUFPvvNCCSwWikRQ7I73itjprQw9Qf7ojrJg6gDiVFh 5SE0dihQ9OXcNffN/qFKL4LxtXmR+qfgkG6ImkW/sovK+3i976nNjJ6DrMCTv3ZQHVKR vawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724310851; x=1724915651; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jnbwyZ8nm7OA7xAj7wrWrabgK1t5zgYyH3DelQTt/t4=; b=Ij5N34AdApFgH/nJJ0NruhRlMn2LWsHjdiGoTnHogMFpzxQQQBdg4A9FGY6Gs+ffGP PcZsd7w8GiYQKPZ6dZDvJrnns03JMg2DJGyaUoPTP/2gsZ7QV+az/xGA7RxvZgMznxpP 1F4kOCelt8SDaGFL0XPGY42DJgca86MX1eIhpLjKt9n7KsaH7xSoN28O75ktsEKT/sYO 3TLm2ms4IdNCPofPEyLZDIczJuCQvmRXCHQKzNbRKxyb1vwzfiY8BQSjxUC0b9JtV5KS q0hYMDeiJdp5ceckjEkV8xxASPZX09pj80kSOm/1K/GP5VqdG21uCI5Lpe9/Datibznp TLwQ== X-Forwarded-Encrypted: i=1; AJvYcCVw46vWRUR6/e29jpaagqGaIEIWlzjI8c58tdR79ThQ5I2V6++h4qK5nA9TDAUSbRuN4BkCVhnIJadSO56F6fxD@lists.infradead.org X-Gm-Message-State: AOJu0YwgryRlEH759kS9Fa4pSbuf2QXzjUpzmWz/s75hdcedqfGCDsdR whOfOUS+WrmR066rc4+0h31qAISnOUj3l0kFqgsILheKC+tKxz1phm3KdTWGFa8= X-Google-Smtp-Source: AGHT+IGXmNRuv+mQEijx6lEwkmYjHk6XirTogWRG+N5Gk1h3xzTz9eMzqUkZv9fzF0cNQyeHFRUhTA== X-Received: by 2002:a05:6a00:c93:b0:70d:3777:da8b with SMTP id d2e1a72fcca58-714235a5404mr6267050b3a.25.1724310851578; Thu, 22 Aug 2024 00:14:11 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([240e:473:c90:f96:d029:ea8a:4e6d:d272]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7cd9ac994a3sm695095a12.16.2024.08.22.00.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 00:14:10 -0700 (PDT) From: Qi Zheng To: david@redhat.com, hughd@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, vishal.moola@gmail.com, peterx@redhat.com, ryan.roberts@arm.com, christophe.leroy2@cs-soprasteria.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Qi Zheng Subject: [PATCH v2 04/14] mm: filemap: filemap_fault_recheck_pte_none() use pte_offset_map_ro_nolock() Date: Thu, 22 Aug 2024 15:13:19 +0800 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_001412_532580_49375A68 X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In filemap_fault_recheck_pte_none(), we just do pte_none() check, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 0f13126b43b08..c98da9af6b9bd 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3234,8 +3234,8 @@ static vm_fault_t filemap_fault_recheck_pte_none(struct vm_fault *vmf) if (!(vmf->flags & FAULT_FLAG_ORIG_PTE_VALID)) return 0; - ptep = pte_offset_map_nolock(vma->vm_mm, vmf->pmd, vmf->address, - &vmf->ptl); + ptep = pte_offset_map_ro_nolock(vma->vm_mm, vmf->pmd, vmf->address, + &vmf->ptl); if (unlikely(!ptep)) return VM_FAULT_NOPAGE;