Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3682453pxj; Tue, 15 Jun 2021 06:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+pOxmra8Xf82pwknjgu0nNza0mwZihQ9Rfh+Ec9OFfjcbvUSNSa1m314H/xqrKluM2UFP X-Received: by 2002:a17:906:af95:: with SMTP id mj21mr21081461ejb.25.1623763767701; Tue, 15 Jun 2021 06:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623763767; cv=none; d=google.com; s=arc-20160816; b=IiLF7idI+H0uzWjaKSPcah0F8YQr/E+VOV29V0M/nLSljSrntokeC4F6vVFxpAk6nm kDrMcroTo2w0vju26vgbcUilnWXTggxVvBtasznzDiIb2x4YpGpStS0i7MDv2sxhTTWH siyyn94CeWzTQ+Hf6Bdz9wyDft4W5q68XSeMWJY0UPzFsV6p4oTKXi8rjOBj+C8u5GdZ 9xH/2vOUDXfEI/v4RE+GkkIJKF9VgP0PZDG9P5nncjfOePn2lK5tDL+ydLFhe26lDFJH yEc6FSm8LLT18IcJ0tgPjPsfAIdyWSbpiiGRhBxOGfUXmwzX/oldXTa2a/+a2PxJuHhb ldog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tk1mvrcMufCVrgPg3C2xpZf19iy4PPS7BLzt3IIAZvo=; b=gVDyHfVPxSZE68uBKQKjt2cGaKqLeURpzalWhfNP39g3tw/IQVOE1SNDZj9lDm0mpT 3U1pt3b32yy36e1vtD5uJ4jROb9ckxTgBqfq6pul6Tb8bIURhkwI04axwMQBxqzsb/YU aFB9ggHOEMPlR3PSMMVC/guidOMsvQo8VWz6KnHlqfy/5ShVAa4i29dx54vdooGtpSqp CH8ibfRUygH43rQgXzBlLRud9geunrJxLFM8xZnQwe+7q02uRz/wHOWSJQoXsO0beQaA fapOGzSU6EGspVq6V/GN6Bc8ZbGiZQq4GcBQloqWvaqI/DPFjbVE2C5zvBVDkEgeyPRs Xn/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=wANQzPa4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si14101474eja.295.2021.06.15.06.29.03; Tue, 15 Jun 2021 06:29:27 -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=@infradead.org header.s=casper.20170209 header.b=wANQzPa4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230527AbhFON2b (ORCPT + 99 others); Tue, 15 Jun 2021 09:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230452AbhFON2a (ORCPT ); Tue, 15 Jun 2021 09:28:30 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C10C061574; Tue, 15 Jun 2021 06:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=tk1mvrcMufCVrgPg3C2xpZf19iy4PPS7BLzt3IIAZvo=; b=wANQzPa41ytnopaUFssGsxbY/M 0hq96FVjjN51t4RFAdxzVXUFPl0WUQLIbryYoFCPF/RjQES70xir5/HgL6PJk1gNMd37GODvP/1Dm Uzt6nVMXjvWx9mYamO6qDeBp7iZ/XNXIGVbmPHNVofwUiqxf9BcX7viQOfbejADb2yzdjwQuWw1ez Qh42dGYWXVx7ED1ej5SSPI51boZURyYoc8+CShjqpV6o+VAVTSqlIA3wU+IjHhKuwUW7e4eZzbhFS uVX7vILZQklZV3RqCK7W6WJdHFzvyE3HhNauq8NtfVgWYDXTgLnBzDfEQrl8sh75f66KWeuxyh2XB dTCoPkmw==; Received: from [2001:4bb8:19b:fdce:9045:1e63:20f0:ca9] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1lt94D-006nuj-Vv; Tue, 15 Jun 2021 13:25:30 +0000 From: Christoph Hellwig To: Jens Axboe , Thomas Gleixner Cc: Thomas Bogendoerfer , Geoff Levand , Ilya Dryomov , Dongsheng Yang , Mike Snitzer , "James E.J. Bottomley" , Ira Weiny , dm-devel@redhat.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, ceph-devel@vger.kernel.org, linux-arch@vger.kernel.org Subject: [PATCH 02/18] mm: use kunmap_local_dirty in memcpy_to_page Date: Tue, 15 Jun 2021 15:24:40 +0200 Message-Id: <20210615132456.753241-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210615132456.753241-1-hch@lst.de> References: <20210615132456.753241-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org memcpy_to_page can write to potentially mapped page cache pages, so use kunmap_local_dirty to make sure flush_kernel_dcache_pages is called. Signed-off-by: Christoph Hellwig --- include/linux/highmem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 65f548db4f2d..d0497c0daf80 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -333,7 +333,7 @@ static inline void memcpy_to_page(struct page *page, size_t offset, VM_BUG_ON(offset + len > PAGE_SIZE); memcpy(to + offset, from, len); - kunmap_local(to); + kunmap_local_dirty(page, to); } static inline void memzero_page(struct page *page, size_t offset, size_t len) -- 2.30.2