Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1216pxu; Tue, 5 Jan 2021 03:40:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRodb48/1JotJwz4IJt0sh3uAvWhfrt+rvCAsXfdzs2eQzYZ7GbTU8bAbTEAtRpQRMG2JO X-Received: by 2002:a05:6402:22e1:: with SMTP id dn1mr76806773edb.347.1609846812721; Tue, 05 Jan 2021 03:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609846812; cv=none; d=google.com; s=arc-20160816; b=exRYwPE7wq10uV9AvSFScmBdI94ZSjhHp6veQ4QUYohty3mJFWJVmY6h+Ie5O+SFhV e4jgH7K34kTFLClC7VQgk5F3sEyNVl1qjCghyC9mWfYzzRwhf8rBqsMMyVRMT+lNt18/ JGOAvEGtVZSoM/GVzlBmQo6j2WAykYhkSaNbvOHZyBira0RfYNHRJECkEQpXQa75BWs7 frRkfLBGR5Aa/ua7lq+kjRqQN1gZhKKC7MRLzT57D2/6lEklTy17UG0aHd/tEcaKE024 CNxe0091IwgaL2+VouBAxOTGq2oy1cdkHHMNPv9EN6wDe7MmIEKcXdTZIyvcQKmzOf0G limg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=49pn7JgokWv3+bXwTHx/Q1rQiDS6SEBcI2AXDpBGwTw=; b=owKAOYYOYp2woRk2QqH+snnM00ar2vIuJymQJreGBmqAlfNPYXaipUxPmvN+CVeSCG b3u5Rc9MsBAfp2xaFw32/ggvLlmS2D55GiMumyESXI6HtVK2jNQsqH6ZmuzEex/aX7au tM8M+ZSpbgt50bruByZJs9hniV0vnUjetVz8rrrDTbKrBKi1lugED38WT0vmZ3fCAaWy 9XJye/Q4RQdAxIGqsVuvE4xv9MN+7o+LrGb09UYAuhxzpakPO0RvG3C4stFhOFcthJJR zAKRnXCkgadNrSuAuyTENFqzOkWVe7iX2+yGu0Md32zAzf50DqykjBxCJg/L97XfvJIl VFoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a10si33158630edb.130.2021.01.05.03.39.49; Tue, 05 Jan 2021 03:40:12 -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; 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 S1728304AbhAEJq2 (ORCPT + 99 others); Tue, 5 Jan 2021 04:46:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:48894 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728143AbhAEJq2 (ORCPT ); Tue, 5 Jan 2021 04:46:28 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 56758AD29; Tue, 5 Jan 2021 09:45:46 +0000 (UTC) Date: Tue, 5 Jan 2021 10:45:45 +0100 From: Daniel Wagner To: Enzo Matsumiya Cc: Sagi Grimberg , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Jens Axboe , Hannes Reinecke , Keith Busch , Christoph Hellwig Subject: Re: [PATCH] nvme: hwmon: fix crash on device teardown Message-ID: <20210105094545.3tq7c6ev5yn3bhyi@beryllium.lan> References: <20201209213228.5044-1-ematsumiya@suse.de> <4ebb1b8c-4bb0-6ebf-3417-d4aee1bdd3a8@suse.de> <20201230143805.2v4izgkzbnisssvr@beryllium.lan> <20201230151653.ozlqlwef7f2tarwz@beryllium.lan> <20201230153138.4f2jd2yd2vkqndby@beryllium.lan> <20210104210610.hliiupywksawgei3@hyori> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210104210610.hliiupywksawgei3@hyori> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 06:06:10PM -0300, Enzo Matsumiya wrote: > @Daniel maybe try tweaking your tests to use a smaller controller > loss timeout (-l option)? I do this on my tests because the default > value kicks in about 30min after hot-removal -- i.e. you > have to actually wait for the timeout to expire to trigger the bug. As far I can tell, the blktests test I am using will trigger the same bug. The problem is that the lifetime of hwmon sysfs entry should be aligned to the lifetime of the nvme sysfs entry. Currently, hwmon's lifetime is bound to the lifetime of the ctl sysfs entry. When the nvme entry goes away (and obviously also the underlying device), the hwmon sysfs entry still references it.