Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6627763rwr; Tue, 25 Apr 2023 01:00:37 -0700 (PDT) X-Google-Smtp-Source: AKy350a0s2vs5ngoVdwA+kAUKvPwREDK9yBtrteVd97/Hs09sZHMYKdm5J4mrKu1WivvKREAlYOq X-Received: by 2002:a05:6a20:42a7:b0:ee:bac2:c6e1 with SMTP id o39-20020a056a2042a700b000eebac2c6e1mr22178278pzj.23.1682409637072; Tue, 25 Apr 2023 01:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682409637; cv=none; d=google.com; s=arc-20160816; b=XOmig8PjdpDpapiLo+kxKll1C+3gRWHJOvb+EES2VltHnF6rVlf5Or0Aai++SARe2x kSmhzMKLd+HOvluLwMa/RjxmR/x/hFYwAlW0BEidDJT010rSIMJx52JshUUZHUZIKmjU 7c09NUTEKb+1Ppo2xnYKzxDPD5ZfP12z35O6iBkE1BfcZz1DE+P0d/XfwrE9L6+M0wwL eNe0m3oMURQKXctq4dPdFHK8qwIprjydtiu289EKa+vvZm2x1IwzGCdKQknPpNbf54RG Bj8Aq0qvkidci7h4Pe+6lMn6aaZHnHn7fO+GQBGF3Ilapezs94ULSIp6bzqUb7+qbFVN XD8Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=OmmEzTJCPA00VXRdIVImMcsSSNp63qrebtBgMEK/Qdo=; b=yg9eTDoGCVWChlJKz/lsPrhcdFIHmP66MBDN9+uLM6TVxyH+8mFTqhDziuCTPlEECt 0ccy9e7hP2Gv5/tyXoI+NiYsMps+X7Dw/acGGkVwN+3HgmRne/Lw93iKwQONiJk2kzn3 Nw9vDilW0blgwsrC4WGq33MKV4ALP7fNhVgGgvAUtLBRFp5fqSj2TQWYTHMcAABmBSYW tmkORfLB8rK4V0+/Ns8zzGnORwDhh9F901mV41gW8PQzxx3HkBnBJDcg9g1v+HzC8QI8 RV6FereutVkzieRXK8GwW3LHfluH+yxYyGWlEk4N3cg9LtU6xWjsbEPzaqKK6m0KPJxv 6YzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZQbyszvv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv130-20020a632e88000000b00519cded0624si13286867pgb.899.2023.04.25.01.00.24; Tue, 25 Apr 2023 01:00:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZQbyszvv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233281AbjDYH7f (ORCPT + 99 others); Tue, 25 Apr 2023 03:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233383AbjDYH7b (ORCPT ); Tue, 25 Apr 2023 03:59:31 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BE0AE4E; Tue, 25 Apr 2023 00:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682409570; x=1713945570; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Gocix4vBihVS2BVVbk9Z88th8E0zeu5NrQL381uKtvk=; b=ZQbyszvvJQ3k/bVwlHm0JKpwPubxESydTSY4zjIiZggljrpuhGEErtj4 4DjLtPqJ9S4BsmZuFeqgZUfiCpKvl8S+KVPwopRbE6dlXL+0wctlKCNt3 SnTKJbASd5JPhLY7xvIbJWQNMqn1WP0JKSe+p5mgIaKo7iEsA5+u1OC7w juuq7DBfOaCUGuUvEPkhjojvTuXVZ+u2tABb5AKB0p0ltZMfRHCieZPE6 8dvegy95WdsCy3ujpPrVt9KFUA5HffzC5JwTqXroDHLvcAbZ5aBmfHy2+ BxI+4u4iOJNGkvDlHOSbLSv19a0BHyAN+vMTNlsKyf2PnDiofpNFIbsVm Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="409630585" X-IronPort-AV: E=Sophos;i="5.99,225,1677571200"; d="scan'208";a="409630585" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2023 00:59:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="1023038048" X-IronPort-AV: E=Sophos;i="5.99,225,1677571200"; d="scan'208";a="1023038048" Received: from st-server.bj.intel.com ([10.240.193.90]) by fmsmga005.fm.intel.com with ESMTP; 25 Apr 2023 00:59:14 -0700 From: Tao Su To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, tao1.su@linux.intel.com Subject: [PATCH] Remove blkg node after destroying blkg Date: Tue, 25 Apr 2023 15:59:11 +0800 Message-Id: <20230425075911.839539-1-tao1.su@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kernel hang when poweroff or reboot, due to infinite restart in function blkg_destroy_all. It will goto restart label when a batch of blkgs are destroyed, but not remove blkg node in blkg_list. So the blkg_list is same in every 'restart' and result in kernel hang. By adding list_del to remove blkg node after destroying, can solve this kernel hang issue and satisfy the previous will to 'restart'. Reported-by: Xiangfei Ma Tested-by: Xiangfei Ma Tested-by: Farrah Chen Signed-off-by: Tao Su --- block/blk-cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index bd50b55bdb61..960eb538a704 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -530,6 +530,7 @@ static void blkg_destroy_all(struct gendisk *disk) spin_lock(&blkcg->lock); blkg_destroy(blkg); + list_del(&blkg->q_node); spin_unlock(&blkcg->lock); /* -- 2.34.1