Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp110878ybg; Sat, 23 May 2020 08:46:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGcGHZOyS4C5sMWilC8muATbO1ytXU9sxsSCG/zzcHTG41ONf5Poa2jpffAFpUf5YYMhXJ X-Received: by 2002:aa7:d1c6:: with SMTP id g6mr7631674edp.303.1590248808214; Sat, 23 May 2020 08:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590248808; cv=none; d=google.com; s=arc-20160816; b=kipjdMdPJ0MWFAf8gmFrF49Xbs4vv931oCOekC2Zm/AFbAo/NlfebmFEjJOtKCioBH imvMVSAoij5CYY6HuuXAA731+jKOGiNuqblBWs+VT5A/may9ZO5wGXeYOcYCya5+L8cn FnK1Jyjd+qINjEM7yxQ6AhlI0VmEZXK+kn5Kurr3r5Zg1fSUwQ+ir2jm7ltM7n7EE7SZ RWA478eXCBULS8IsOch0v7jPhteoqmite0s2OMI156tjxGMDgXYOHMvegGg25bx/QNlW EwlNB09ThKxEFELgBk3xRGS9qzHDsvd8Aecr0VyLoV5LfjpItGtiFb3oZGXP2G+IzydJ wdOQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=U+IiB+papUoUppksQW3XAeJEGMtGqdvxwQ2rfkDXF6w=; b=Xrssl0U60evU986PoX0xgvWhFkyMAj/J9GCcdM+H1OdVxTUxB5uTRuta4I8aAmu/vU m4EJHtMgQr03vgXGFg8VPHO3mS+wpkitkNrr165r3t4tYG3JjHTcfqdp+oDsqUDAtcTs L1qKE3f23/rNWdCg1jsJYkwhoPNOePGljSOQg6mhhW1GeFwgGToDLdlUg7PhhrDkv2fW Zgc35bhnyy002xMt1sdnsrFVw20T0IGaycUNKhiiI/d2X40z2OATDxRtTxINjYMnwrro lmotDb1j4DA0Wyqm70iRIFs6gEGl6kMfKhV6PwhxVJhr2xc9UAQfnhEylWR3qDKnzMKj CHfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=l6twRXzp; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm10si5944985edb.82.2020.05.23.08.46.23; Sat, 23 May 2020 08:46:48 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=l6twRXzp; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726868AbgEWPoW (ORCPT + 99 others); Sat, 23 May 2020 11:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbgEWPoW (ORCPT ); Sat, 23 May 2020 11:44:22 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC5EC061A0E for ; Sat, 23 May 2020 08:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=U+IiB+papUoUppksQW3XAeJEGMtGqdvxwQ2rfkDXF6w=; b=l6twRXzpi1M+m6dRlqOPDGPpPs aO+BWJb/XO8CpcmwvLgN/2KjhJbwd2NaYlXSAbsWUb/598ynJyJ4417WQKiL6H3iMGo5JEqrb3QAe +8wpDEyRK2+dJ1Rv4cpdkk1KlZUwLVaTXqbQ3+sp8ka7XJUx+eRKeDhKZJkRukyovD41jcOngeptd C7eml3Iftujw7RwCn0OTmRqncOF2D9kRjSX9HrPGkhESICDG5GllHeVSe4DS2yjYX1wRcyNR/4nmA 9OjKSJcL7o7uGv8CP1YhXWz1mskEtVWNxZAhtYh02cTeU18oCQ2byzoBWkp8zkIY9ckkTwnQ5WEuo jfjcORnQ==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcWJk-00077y-1i; Sat, 23 May 2020 15:44:08 +0000 Subject: Re: [PATCH] kobject: Make sure the parent does not get released before its children To: Greg Kroah-Hartman , Heikki Krogerus Cc: linux-kernel@vger.kernel.org, Naresh Kamboju , kernel test robot , Brendan Higgins , "Rafael J. Wysocki" References: <20200513151840.36400-1-heikki.krogerus@linux.intel.com> <20200523153643.GA226270@kroah.com> From: Randy Dunlap Message-ID: <7a5e4740-8099-ef70-776f-0d92ce84ab3d@infradead.org> Date: Sat, 23 May 2020 08:44:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200523153643.GA226270@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/23/20 8:36 AM, Greg Kroah-Hartman wrote: > On Wed, May 13, 2020 at 06:18:40PM +0300, Heikki Krogerus wrote: >> In the function kobject_cleanup(), kobject_del(kobj) is >> called before the kobj->release(). That makes it possible to >> release the parent of the kobject before the kobject itself. >> >> To fix that, adding function __kboject_del() that does >> everything that kobject_del() does except release the parent >> reference. kobject_cleanup() then calls __kobject_del() >> instead of kobject_del(), and separately decrements the >> reference count of the parent kobject after kobj->release() >> has been called. >> >> Reported-by: Naresh Kamboju >> Reported-by: kernel test robot >> Fixes: 7589238a8cf3 ("Revert "software node: Simplify software_node_release() function"") >> Suggested-by: "Rafael J. Wysocki" >> Signed-off-by: Heikki Krogerus >> Reviewed-by: Rafael J. Wysocki >> Reviewed-by: Brendan Higgins >> Tested-by: Brendan Higgins >> Acked-by: Randy Dunlap >> --- >> lib/kobject.c | 30 ++++++++++++++++++++---------- >> 1 file changed, 20 insertions(+), 10 deletions(-) > > Stepping back, now that it turns out this patch causes more problems > than it fixes, how is everyone reproducing the original crash here? Just load lib/test_printf.ko and boom! > Is it just the KUNIT_DRIVER_PE_TEST that is causing the issue? > > In looking at 7589238a8cf3 ("Revert "software node: Simplify > software_node_release() function""), the log messages there look > correct. sysfs can't create a duplicate file, and so when your test is > written to try to create software nodes, you always have to check the > return value. If you run the test in parallel, or before another test > has had a chance to clean up, the function will fail, correctly. > > So what real-world thing is this test "failure" trying to show? -- ~Randy