Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp371310ybh; Wed, 22 Jul 2020 02:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpgtK6aIFIzdadKqRPcsEkjmKqk/emgn7HQb7T6vEgR1nQgPbiSKuM5dFzHuX3pj3tAYe4 X-Received: by 2002:a05:6402:1d97:: with SMTP id dk23mr30750587edb.1.1595411321065; Wed, 22 Jul 2020 02:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595411321; cv=none; d=google.com; s=arc-20160816; b=dDLplH5rntdRi2PICqqm/lUJLu1VLVG0y0ajAWTaI8vAjn4UaM56LF4APQBC0x2lqi k1TnPFeGTY7KJ/9f+IO+OAyStI10Byka9KVKXwScvfHDUEquHiO8zhkQLINlJENiTBvW PODfrJXlAfhAJ3Lhudq4bJdPezRgo3itoQaXt0FqON3JOy853oZNM0D1a1a9izJnKwed F5JXh4DEYdUnbdNw/iTXB5EI+y0tKjgGrg4Df1E05XP+F8j9zvElXB0C9fRJBDRi3235 KRgr83tsMsOSmoUMwZWqALnbHHgXzt8Z856ZcxcSKGzG7mYJxarAfDyuuhSPipcZ6Mw2 UQ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+W3E9XgHb0G6nVszkRK+6uLSR1+J1W6QhVtycYSbEnM=; b=GdaKvUN/m6Mr0RnVPrDKdkrNYs1Vnu+dgMBWrQCBqFM8f0ng9Jmk8CdLo7nXm7lOOs uY4kXv8JIyqGJAymh0wqqcIUsI+Y7VTgkHlccc99id7ksR3k3T2cWapgCxoE2SA4Aikv AxCYuyJyeOd0XNyXubw3AM4r/TcgUBU+Ig4uKCtRIrGlLOJLtVFj9ymrQOrSOgQZquRl iBRWTM81NQJpp36CcWYFpk/JRtL3lv9GksISZkg6mLWvqh0KrMyshfmOyVwBhGY95rEi DHoX08+DIqh+Rej4YcQhB5wCuPoiwibS5jVEPfBMP1v1EE5DLTl5y1L5BBhqSlWjiIJA b+ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q5FcEu85; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si13630126eju.669.2020.07.22.02.48.18; Wed, 22 Jul 2020 02:48:41 -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=@redhat.com header.s=mimecast20190719 header.b=Q5FcEu85; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731710AbgGVJqV (ORCPT + 99 others); Wed, 22 Jul 2020 05:46:21 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30367 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731673AbgGVJqT (ORCPT ); Wed, 22 Jul 2020 05:46:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595411177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+W3E9XgHb0G6nVszkRK+6uLSR1+J1W6QhVtycYSbEnM=; b=Q5FcEu85Q6u06iAFleGWIxzV+HdCQLfPGLnvUWCzjbzicA62lbsiigEwflXsuyiQy8LhGA dOOKeXKk60uK7JwkMfqyX1Mim7jheveVXtMD6WqDtoiOv+8lcb5hkp1kX04xkShmhjrZIx wcHUwrJoI42QfINaviNhpH4aletPvO4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-JEKjV4nNODe2wf8t2d3zAw-1; Wed, 22 Jul 2020 05:46:15 -0400 X-MC-Unique: JEKjV4nNODe2wf8t2d3zAw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62261800460; Wed, 22 Jul 2020 09:46:14 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-254.ams2.redhat.com [10.36.113.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id B10BD5D9CA; Wed, 22 Jul 2020 09:46:12 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-mm@kvack.org, David Hildenbrand , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Gerald Schaefer Subject: [PATCH v2 4/9] s390/vmemmap: cleanup when vmemmap_populate() fails Date: Wed, 22 Jul 2020 11:45:53 +0200 Message-Id: <20200722094558.9828-5-david@redhat.com> In-Reply-To: <20200722094558.9828-1-david@redhat.com> References: <20200722094558.9828-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cleanup what we partially added in case vmemmap_populate() fails. For vmem, this is already handled by vmem_add_mapping(). Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Gerald Schaefer Signed-off-by: David Hildenbrand --- arch/s390/mm/vmem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 43fe1e2eb90ea..be32a38bb91fd 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -332,8 +332,13 @@ static void vmem_remove_range(unsigned long start, unsigned long size) int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap) { + int ret; + /* We don't care about the node, just use NUMA_NO_NODE on allocations */ - return add_pagetable(start, end, false); + ret = add_pagetable(start, end, false); + if (ret) + remove_pagetable(start, end, false); + return ret; } void vmemmap_free(unsigned long start, unsigned long end, -- 2.26.2