Message ID | 20200122092809.942698826@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=TRKd=3L=vger.kernel.org=stable-owner@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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 CD356C2D0DB for <stable@archiver.kernel.org>; Wed, 22 Jan 2020 09:48:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FCA42468A for <stable@archiver.kernel.org>; Wed, 22 Jan 2020 09:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579686494; bh=0BtmGPs22M/KN4vGklPBEDBxRLyDfhHLM8jbiNuJg5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HXN0nVQUi8teVZdY/leMPbTcPeDQLMnG+rG4iEG+vbfD/JES1M6s6bo8Pu2AnqD4O OqWKYpr0XkXMBsatUXeWwGKIwQ7glYfmf5C3/nz6Fy+ZDuh87mzaH6OyPJoKwbnyoY ous94v0c8c88RfEq3ayva7+jM5hCP/SGx9lt21P8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729827AbgAVJsO (ORCPT <rfc822;stable@archiver.kernel.org>); Wed, 22 Jan 2020 04:48:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:32830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387586AbgAVJld (ORCPT <rfc822;stable@vger.kernel.org>); Wed, 22 Jan 2020 04:41:33 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F33924684; Wed, 22 Jan 2020 09:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579686092; bh=0BtmGPs22M/KN4vGklPBEDBxRLyDfhHLM8jbiNuJg5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tTXheWnD7G7mgt6ZMvfm0+scsbXDLv4Gizga19rP3I9wrfSRI8pG2U19zWxHKd8lo Tq2INDtJZnzKTV76mvXLYUFw+s24O6lmj8lyWGRL+yGjuDiSAtdHvCNE5N1uwhZWkp 63ASbdWb4j70B5zpfVFYYpSq1ahlmN7LbwHNRybo= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, "Willhalm, Thomas" <thomas.willhalm@intel.com>, Dan Williams <dan.j.williams@intel.com>, "Bruggeman, Otto G" <otto.g.bruggeman@intel.com>, "Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org> Subject: [PATCH 4.19 040/103] mm/shmem.c: thp, shmem: fix conflict of above-47bit hint address and PMD alignment Date: Wed, 22 Jan 2020 10:28:56 +0100 Message-Id: <20200122092809.942698826@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092803.587683021@linuxfoundation.org> References: <20200122092803.587683021@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/mm/shmem.c +++ b/mm/shmem.c @@ -2072,9 +2072,10 @@ unsigned long shmem_get_unmapped_area(st /* * Our priority is to support MAP_SHARED mapped hugely; * and support MAP_PRIVATE mapped hugely too, until it is COWed. - * But if caller specified an address hint, respect that as before. + * But if caller specified an address hint and we allocated area there + * successfully, respect that as before. */ - if (uaddr) + if (uaddr == addr) return addr; if (shmem_huge != SHMEM_HUGE_FORCE) { @@ -2108,7 +2109,7 @@ unsigned long shmem_get_unmapped_area(st if (inflated_len < len) return addr; - inflated_addr = get_area(NULL, 0, inflated_len, 0, flags); + inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags); if (IS_ERR_VALUE(inflated_addr)) return addr; if (inflated_addr & ~PAGE_MASK)