Message ID | 20240503095353.3798063-7-mcgrof@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D6BEC10F16 for <linux-mm@archiver.kernel.org>; Fri, 3 May 2024 09:54:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBE626B009D; Fri, 3 May 2024 05:54:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D60046B00A3; Fri, 3 May 2024 05:54:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CB196B00A4; Fri, 3 May 2024 05:54:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 598EC6B00A1 for <linux-mm@kvack.org>; Fri, 3 May 2024 05:54:06 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 21D3080D7B for <linux-mm@kvack.org>; Fri, 3 May 2024 09:54:06 +0000 (UTC) X-FDA: 82076623692.02.38918D6 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP id 08A7540003 for <linux-mm@kvack.org>; Fri, 3 May 2024 09:54:02 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=zmPDneZ5; spf=none (imf01.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714730043; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nRtRAstCK6XovsdzKMdtb1ZkfTlghtD3bCyykPEedow=; b=UxWqFJJOhi/7fcdcD1UgWTu5mmwh+xXXPJiqBdeeeNuc15xSMgje1e8AGdIt02dNHJbaPf BqzGMdxYGiLwIDwXAQWRKJfeyXcrm9qFC1pmtqdMj5+wi3R7j9nZxIBPg6a3rnPAa3rDgw NR/xDhWm+cb4iMHsSemhjFXm9vTo0Sg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=zmPDneZ5; spf=none (imf01.hostedemail.com: domain of mcgrof@infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=mcgrof@infradead.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714730043; a=rsa-sha256; cv=none; b=vuDjxAA5qnaWR2fxlHzmZa46/yilZ11XKZzBYOEhhXyh8gvOYcYDN0iDUKoDAFlGNRFHSk tgsLP6gaqPmgJ3vl/7aiVaFxuilr33eDdxQM3EcysFiB1exoFQXhSRcOg2GZZHpeXNQPLw R2e08rq5FkOFFOeSZgFFU93myw2rcHA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=nRtRAstCK6XovsdzKMdtb1ZkfTlghtD3bCyykPEedow=; b=zmPDneZ5u8fBg/U/VAf8Y7kMBk fQGPvx0dr0ft+5FRbv17vC+ZfyDY57TML0UL79hvywkUDniQVm42l2NU77zPURlD7PLhUZwSMII6f oT8WI3l17HyIhiidVzG5MbYxHBIg1IO9TW97dY91khyxpxfGge6PYXZ5wRcmDxNocwnBofxjWGkGJ cdkPPx3tGWUb+f0BP6Zd8Z6UO5C/uidhgWvihvgQiUe+YBsvKchXmMh9IK8782IVekKoLzhla5IJ/ YlGKXVfR7z0SDjI9IJ553dElW0MtF1thN2w8y13fwkPOCvSmXhjcsyZlu++C8Cc78J8JuuOA116uR ODRZgDaA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2pc3-0000000Fw3k-12zt; Fri, 03 May 2024 09:53:55 +0000 From: Luis Chamberlain <mcgrof@kernel.org> To: akpm@linux-foundation.org, willy@infradead.org, djwong@kernel.org, brauner@kernel.org, david@fromorbit.com, chandan.babu@oracle.com Cc: hare@suse.de, ritesh.list@gmail.com, john.g.garry@oracle.com, ziy@nvidia.com, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, kernel@pankajraghav.com, mcgrof@kernel.org Subject: [PATCH v5 06/11] filemap: cap PTE range to be created to allowed zero fill in folio_map_range() Date: Fri, 3 May 2024 02:53:48 -0700 Message-ID: <20240503095353.3798063-7-mcgrof@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240503095353.3798063-1-mcgrof@kernel.org> References: <20240503095353.3798063-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 08A7540003 X-Rspamd-Server: rspam06 X-Stat-Signature: b15egjjq8xf8y9cq3g4ogn7ozes4ypuw X-HE-Tag: 1714730042-710836 X-HE-Meta: U2FsdGVkX18jQv0p7pZTUeAGNb83sCh8W8Xh+8abKpgWbKoLAiC0XIMyPK1QUwYsVxSyOhjWioKGl/LgsHg+qR3WYma6gpMfNZiZxSte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dtCKbyyuSYL242OAja75MmlaPvz2qkvaa1su2mdPSGZKrxOmkTJQYvb7d4igmkNXywg8TXiTWrdO6acMRGewRNS4DiwA4itIofDxygEMywvFdwf3WhTBJA1i2OiXG9BO+++KHTNrWdtGu/eJBcGs78S6WUSfDMitjcKxhdPRlvXOwy1/y1cZ3BcDjgPiMXK5kKyNm2YS69GWxKiVa5kFBEguB7vVGk4SAyENYszETt/u1XCyoKD4k3okX5kc+mPDeJ6XQJntH1F+ID1qcuvDuhCC8S5qXldrHyiPsURqVm+Y914AeBUWwwAV0x2QAWNUIwrecOLUgbM4OVDaybXUzvAyUch 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
enable bs > ps in XFS
|
expand
|
diff --git a/mm/filemap.c b/mm/filemap.c index f0c0cfbbd134..a727d8a4bac0 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3574,7 +3574,7 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, struct vm_area_struct *vma = vmf->vma; struct file *file = vma->vm_file; struct address_space *mapping = file->f_mapping; - pgoff_t last_pgoff = start_pgoff; + pgoff_t file_end, last_pgoff = start_pgoff; unsigned long addr; XA_STATE(xas, &mapping->i_pages, start_pgoff); struct folio *folio; @@ -3598,6 +3598,11 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf, folio_put(folio); goto out; } + + file_end = DIV_ROUND_UP(i_size_read(mapping->host), PAGE_SIZE) - 1; + if (end_pgoff > file_end) + end_pgoff = file_end; + do { unsigned long end;