Message ID | a0d9b53-bf5d-8bab-ac5-759dc61819c1@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=BPbg=LD=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1035C47095 for <linux-mm@archiver.kernel.org>; Wed, 9 Jun 2021 04:17:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75ED6601FC for <linux-mm@archiver.kernel.org>; Wed, 9 Jun 2021 04:17:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75ED6601FC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B4F56B0036; Wed, 9 Jun 2021 00:17:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 064BD6B006E; Wed, 9 Jun 2021 00:17:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E203C6B0070; Wed, 9 Jun 2021 00:17:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0122.hostedemail.com [216.40.44.122]) by kanga.kvack.org (Postfix) with ESMTP id B32E66B0036 for <linux-mm@kvack.org>; Wed, 9 Jun 2021 00:17:00 -0400 (EDT) Received: from smtpin34.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 47C9D8249980 for <linux-mm@kvack.org>; Wed, 9 Jun 2021 04:17:00 +0000 (UTC) X-FDA: 78232875000.34.491D717 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by imf10.hostedemail.com (Postfix) with ESMTP id B6E3B40002C1 for <linux-mm@kvack.org>; Wed, 9 Jun 2021 04:16:56 +0000 (UTC) Received: by mail-qk1-f173.google.com with SMTP id u30so22487298qke.7 for <linux-mm@kvack.org>; Tue, 08 Jun 2021 21:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=pMyjc9CYqvbfrzl29URaDu3TgxtX0dXCEwyNP3GAvus=; b=e+RJ2E4Zeq65xDwtDBfefBHjqSQnt+ObhFB8cWd4WRWktC46wAECrkAZKegtHdI57U HyS/iTRZE/hQ/0dcjCit9KO1wTdujI5nzTGsQKyg9bQ9N2gU1tj4YVT8ng8kZREo+E96 xARjzVhT8FwML3scpPqULTgmVCY4SQM+lYFSWhA8HS/odAxZoSccQjNwV2nTcEMzZSqQ DIY1QHUYRNURhsUZE2XmNWgYyGCdf5Aae/6I2/mYb8dovDNSfNE1rHjzju6+5ttvsrpP qJbZyxiXkKTI3g8+QTZRDVwQ/qMO+rxvZW0EGckKBU+OweiVkeyZ3hQbL4N4AXxrI7DL 0XyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=pMyjc9CYqvbfrzl29URaDu3TgxtX0dXCEwyNP3GAvus=; b=Laq5Z90Cj6JYLJ20lNAjaDKb64yn/i7ZXROMXhoZldJZ9EHg/yiqtVUYyG12QuvVIb 6AqX0sQH2SihKgVca9/nC9aogLCfP3mzW92RIbZ4RiiFLYuZWgAE73rM4wS+iEYqEF/c SONNH7f/+OFaEQCQFJGu1b/EjL34GGeaOg8IBaOl4fXHQZU8Vrbrtz3AGzY/7IlDUdqG oQXwbT8KfKlIhTcsU7L3lROMTYRbNCmoCQCvKBP4ohc3wpLUkAz/9rgoDnenl9Kac3ES gfukvpXN6JnLPeBw2ijvTxHkmBedPw/ovmmOkDBU6TAIs3jHvufGM8ZbKgTSnOqK457M dBDg== X-Gm-Message-State: AOAM531Rvv/06pXRtdN4tuHOxd7VOmODPbnwjQMuAw1UztTPsbDh+Myt Qgxe+yYUeOiKBoCBPXtBp+h5nw== X-Google-Smtp-Source: ABdhPJzwS8WKYUfmOquNK2fdMAaAFTRZEgzgFXIqA/SGDE+nqIO6HtJ9kNcpbTsmL3mRhIqH41zW8g== X-Received: by 2002:a05:620a:39e:: with SMTP id q30mr25347667qkm.116.1623212219181; Tue, 08 Jun 2021 21:16:59 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id k19sm7673587qkj.89.2021.06.08.21.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 21:16:58 -0700 (PDT) Date: Tue, 8 Jun 2021 21:16:55 -0700 (PDT) From: Hugh Dickins <hughd@google.com> X-X-Sender: hugh@ripple.anvils To: Andrew Morton <akpm@linux-foundation.org> cc: Hugh Dickins <hughd@google.com>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Yang Shi <shy828301@gmail.com>, Wang Yugui <wangyugui@e16-tech.com>, Matthew Wilcox <willy@infradead.org>, Naoya Horiguchi <naoya.horiguchi@nec.com>, Alistair Popple <apopple@nvidia.com>, Ralph Campbell <rcampbell@nvidia.com>, Zi Yan <ziy@nvidia.com>, Miaohe Lin <linmiaohe@huawei.com>, Minchan Kim <minchan@kernel.org>, Jue Wang <juew@google.com>, Peter Xu <peterx@redhat.com>, Jan Kara <jack@suse.cz>, Shakeel Butt <shakeelb@google.com>, Oscar Salvador <osalvador@suse.de>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/10] mm/thp: fix page_address_in_vma() on file THP tails In-Reply-To: <af88612-1473-2eaa-903-8d1a448b26@google.com> Message-ID: <a0d9b53-bf5d-8bab-ac5-759dc61819c1@google.com> References: <af88612-1473-2eaa-903-8d1a448b26@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: B6E3B40002C1 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=e+RJ2E4Z; spf=pass (imf10.hostedemail.com: domain of hughd@google.com designates 209.85.222.173 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: bnfmtnjhz967muwnqo4bda9mdkd61k6c X-HE-Tag: 1623212216-573584 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> |
Series |
mm/thp: fix THP splitting unmap BUGs and related (fwd)
|
expand
|
diff --git a/mm/rmap.c b/mm/rmap.c index 144de54efc1c..e05c300048e6 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -716,11 +716,11 @@ unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) if (!vma->anon_vma || !page__anon_vma || vma->anon_vma->root != page__anon_vma->root) return -EFAULT; - } else if (page->mapping) { - if (!vma->vm_file || vma->vm_file->f_mapping != page->mapping) - return -EFAULT; - } else + } else if (!vma->vm_file) { + return -EFAULT; + } else if (vma->vm_file->f_mapping != compound_head(page)->mapping) { return -EFAULT; + } return vma_address(page, vma); }