From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58ED9C433F5 for ; Mon, 18 Oct 2021 08:15:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FB0B61357 for ; Mon, 18 Oct 2021 08:15:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhJRIRV (ORCPT ); Mon, 18 Oct 2021 04:17:21 -0400 Received: from verein.lst.de ([213.95.11.211]:60908 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231199AbhJRIRU (ORCPT ); Mon, 18 Oct 2021 04:17:20 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id EACFB68BEB; Mon, 18 Oct 2021 10:15:05 +0200 (CEST) Date: Mon, 18 Oct 2021 10:15:05 +0200 From: Christoph Hellwig To: Zqiang Cc: Christoph Hellwig , Hao Sun , Hillf Danton , hch@infradead.org, willy@infradead.org, Linux MM , Linux Kernel Mailing List , syzkaller-bugs@googlegroups.com Subject: Re: WARNING in __init_work Message-ID: <20211018081505.GA28629@lst.de> References: <20210907074432.3711-1-hdanton@sina.com> <20211018044745.GA23657@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 03:21:18PM +0800, Zqiang wrote: > I find in add_partition(),  if the device_add() return error, we will drop > disk object reference count, > > but i find put_device(pdev) (will call part_release())and put_disk(disk), > both will reduce the reference of the disk object , however we call > get_device(disk_to_dev(disk)) only once > > or Did I miss something and didn't analyze it? Yes, this sounds correct. Do you want to send a patch or should I prepare one?