Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9404893pxu; Mon, 28 Dec 2020 15:23:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzA4SRyLJEe8joWFUH0Xeyhz7k27eJ9IW24Mg8fB++bmA4y4mFaTEGsJc+GPBoJDd4iIdsB X-Received: by 2002:a50:9e8b:: with SMTP id a11mr43554193edf.276.1609197838055; Mon, 28 Dec 2020 15:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609197838; cv=none; d=google.com; s=arc-20160816; b=xTU2K4+KrV8eMZ/u3gKKv8kOmaIeZV6bEL0wp9zAQN05NXcY5Jyrk85i6/i5TT06Au 42fR/7wniGaPXHtVR8g3oTXiJnWl9c8YIrtGRaV1Jht+TKYrjvNBispXsLSv/IHTVRdv g1gCycbX7fRY1nkV2eiX/jfttEFUNWHA14gN5+utdApYPkJ4ikbNv/F00BloTo63QKTu bLXScb477K5PdziH1Pu8UBgsD9TLhS3T/L3e/ghDQi+YlqIEkvKKaqfkqVLEwRwhEvft ePPzYWHwNuN8d1GKkGWGNtQJodiOOGlJ9a3Kcq1PNNBmTUnkNgzP2C+2QsoCkD9xj97I VL5A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u44y7aIg+6OsMAVbOAYZjdSyRByrY2NI7s2XzXeynUo=; b=loP5GStPsJOls1RgF/4xNsWQE5X6GJuZ3k2o0nAXSZz/5Z30qUB06DP8RCPsCQhU4h HP/v+wPJkL53yQDVptgbSl+13S8qLgV2ztkq0I+LwbHq0ODNo+bMGW2yGpSJCN0ziHXG 4+od2t6MVIPNi2EdtqyMgmkydDWmIF8ptdseDVviEjLoJdHLcVOZUlPihf9EQvZ/13pm zkrQiDtJ3B6ImmteXVbEtoL6Zv7qc10Zpbxksm3BHQHm7Nt2OD5Cel4kR4PPI4ZJoG0q QQeLjT4SGOb8ZlPrmtkF9q1ns40OiD7wXrfo+9NMvNse/ma52LoJy+RWoysh+Zq6BqPq 0mag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eSQUU0Im; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si24157354edy.394.2020.12.28.15.23.36; Mon, 28 Dec 2020 15:23:58 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=eSQUU0Im; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502825AbgL1OXg (ORCPT + 99 others); Mon, 28 Dec 2020 09:23:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:56518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502204AbgL1OVC (ORCPT ); Mon, 28 Dec 2020 09:21:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7041C229C5; Mon, 28 Dec 2020 14:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165222; bh=2M+Vy12sDbH78IIVup0knMteF/n3Wto5NcX6m56tYRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eSQUU0ImqqDtrBZ6WOIJQhVxm5HxnpkDqvEP3KPXrRyzWYcoLdMhmA8LdeO+9U1R6 0zB4pI6QE1c1pkIV7swI7ETZHiNuZk8yDN/iJhrFpbuV2sm5dMp8A0FP7zgETWBhbT 4cKuh7X21+7/e3t7sTQf7oeW2w+rnnrX/UNKt3Lc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Mike Kravetz , David Hildenbrand , Mina Almasry , David Rientjes , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.10 456/717] hugetlb: fix an error code in hugetlb_reserve_pages() Date: Mon, 28 Dec 2020 13:47:34 +0100 Message-Id: <20201228125042.816491874@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 7fc2513aa237e2ce239ab54d7b04d1d79b317110 ] Preserve the error code from region_add() instead of returning success. Link: https://lkml.kernel.org/r/X9NGZWnZl5/Mt99R@mwanda Fixes: 0db9d74ed884 ("hugetlb: disable region_add file_region coalescing") Signed-off-by: Dan Carpenter Reviewed-by: Mike Kravetz Reviewed-by: David Hildenbrand Cc: Mina Almasry Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/hugetlb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d029d938d26d6..3b38ea958e954 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5115,6 +5115,7 @@ int hugetlb_reserve_pages(struct inode *inode, if (unlikely(add < 0)) { hugetlb_acct_memory(h, -gbl_reserve); + ret = add; goto out_put_pages; } else if (unlikely(chg > add)) { /* -- 2.27.0