From patchwork Tue Jun 7 09:34:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 12871636 Return-Path: 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 EF1ADC433EF for ; Tue, 7 Jun 2022 09:35:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D85418D0009; Tue, 7 Jun 2022 05:35:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CDFE08D0001; Tue, 7 Jun 2022 05:35:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B338D8D0009; Tue, 7 Jun 2022 05:35:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9CEFE8D0001 for ; Tue, 7 Jun 2022 05:35:04 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 79889CCD for ; Tue, 7 Jun 2022 09:35:04 +0000 (UTC) X-FDA: 79550930928.28.11CC14C Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by imf17.hostedemail.com (Postfix) with ESMTP id B1BB240014 for ; Tue, 7 Jun 2022 09:34:23 +0000 (UTC) Received: by mail-lf1-f45.google.com with SMTP id u23so27415794lfc.1 for ; Tue, 07 Jun 2022 02:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KoD0FJtvAYiro/wAlRb5zLOAm2ljSVphawX93yu7smo=; b=lTqaQnN6yqJuFg22PrQ1ychCB7duFlShGXgJcYA3YXTZ23/6rCXn89SZzsVCCuXNwk fAyAPiksl8n+YyODYbm60Hd4oRw3NqyoehccHyocO3M5pUWDoZJ+uOfLV7auvKjwedeG pgJO752qd9Vvj9NdJGo0Iv9fCCIZg1NEkfTBLDMCry64TNpUFu0GvHHRUEcQpj4q2hIu 772fHfD/oM1dD0AFUusJoVNawrxrMrKudVN4B2argH2tKTHdVFCUco6bLGjusSs5xmfq ZuVO0jNoebGgeiyb26jyQCnjn8c9ciStTmHRcqYLEfe/i01YDdaInFg+xEK4FUA09ZPU Ad7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KoD0FJtvAYiro/wAlRb5zLOAm2ljSVphawX93yu7smo=; b=jEz3IB6cMyq5eXllEBFWg/wtP5O6dtWGCbiKPKCSfnLhRaX0Be+ZFuSEWc494py2W4 7o7twx04dequtm3PXBAksYnBW3H1UVTv51D6EYXzE0CBL5k7G5MxK3d94E9hwvCiv1B8 S0053Vc9zyyHAbXIMaKt7iIhpXctLHulRmwLrwELjKNY9uLAl8YpAcuLkcpKXC9WtdQo Y4XJ5OojjYwc7HpXaUbKIOjwMMnSEMDL8LyeVDetEsNcjp6dXAjdJKYj6p4CUs/vqx0x m4Z8GBWCF3DOi6MJRRcgrHeFDz45JQOLV3EcyECMC6zAx0cjUpB55+0xI1MhAFlMsnTj Y0AQ== X-Gm-Message-State: AOAM5304TjILvqJJMy2m4QnrNzHx9ASJj7PwRfoW8QoPayFqqOmA90rG BU5iK8nJkJYiFoB0Rtdp66Y= X-Google-Smtp-Source: ABdhPJz+nEYe43ymsAQpZtJHQ1/MvaMOMA/s21VY0MJGYYJhjcHNnEvXn54O9Datx6yzWQULld4+1g== X-Received: by 2002:a05:6512:3502:b0:476:c68d:8b0d with SMTP id h2-20020a056512350200b00476c68d8b0dmr18657838lfs.113.1654594502769; Tue, 07 Jun 2022 02:35:02 -0700 (PDT) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id r27-20020a2e575b000000b002554a4ebf5fsm2748043ljd.74.2022.06.07.02.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:35:02 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: linux-mm@kvack.org, LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 3/5] mm/vmalloc: Initialize VA's list node after unlink Date: Tue, 7 Jun 2022 11:34:47 +0200 Message-Id: <20220607093449.3100-4-urezki@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220607093449.3100-1-urezki@gmail.com> References: <20220607093449.3100-1-urezki@gmail.com> MIME-Version: 1.0 X-Stat-Signature: 85zf8t9bshysm9ux7yipguiocd7oacig Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=lTqaQnN6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf17.hostedemail.com: domain of urezki@gmail.com designates 209.85.167.45 as permitted sender) smtp.mailfrom=urezki@gmail.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: B1BB240014 X-HE-Tag: 1654594463-602470 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: A vmap_area can travel between different places. For example attached/detached to/from different rb-trees. In order to prevent fancy bugs, initialize a VA's list node after it is removed from the list, so it pairs with VA's rb_node which is also initialized. There is no functional change as a result of this patch. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Baoquan He --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 745e89eb6ca1..82771e555273 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -978,7 +978,7 @@ __unlink_va(struct vmap_area *va, struct rb_root *root, bool augment) else rb_erase(&va->rb_node, root); - list_del(&va->list); + list_del_init(&va->list); RB_CLEAR_NODE(&va->rb_node); }