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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F9CBC433EF for ; Mon, 20 Sep 2021 12:46:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C122A60F43 for ; Mon, 20 Sep 2021 12:46:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C122A60F43 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6B7466B006C; Mon, 20 Sep 2021 08:46:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66764900002; Mon, 20 Sep 2021 08:46:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 57E2F6B0073; Mon, 20 Sep 2021 08:46:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 4AEBB6B006C for ; Mon, 20 Sep 2021 08:46:01 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 08AA6180AD817 for ; Mon, 20 Sep 2021 12:46:01 +0000 (UTC) X-FDA: 78607924122.24.BA1DEB0 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf22.hostedemail.com (Postfix) with ESMTP id 845971918 for ; Mon, 20 Sep 2021 12:46:00 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id A139E67373; Mon, 20 Sep 2021 14:45:57 +0200 (CEST) Date: Mon, 20 Sep 2021 14:45:57 +0200 From: Christoph Hellwig To: "Paul E. McKenney" Cc: Christoph Hellwig , Dave Chinner , Thomas Gleixner , Stephen Boyd , Andrew Morton , syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Waiman Long , Al Viro , Jens Axboe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [syzbot] WARNING in __init_work Message-ID: <20210920124557.GA18317@lst.de> References: <000000000000423e0a05cc0ba2c4@google.com> <20210915161457.95ad5c9470efc70196d48410@linux-foundation.org> <163175937144.763609.2073508754264771910@swboyd.mtv.corp.google.com> <87sfy07n69.ffs@tglx> <20210920040336.GV2361455@dread.disaster.area> <20210920122846.GA16661@lst.de> <20210920123859.GE880162@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210920123859.GE880162@paulmck-ThinkPad-P17-Gen-1> User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 845971918 X-Stat-Signature: 3zja3enttt8guuh6t6i537bfknpum918 Authentication-Results: imf22.hostedemail.com; dkim=none; spf=none (imf22.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none X-HE-Tag: 1632141960-930088 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: On Mon, Sep 20, 2021 at 05:38:59AM -0700, Paul E. McKenney wrote: > > Well, the block code already does a bdi_unregister in del_gendisk. > > So if we end up freeing the whole device bdev with a registered bdi > > something is badly going wrong. Unfortunately the log in this report > > isn't much help on how we got there. IIRC syzbot will eventually spew > > out a reproducer, so it might be worth to wait for that. > > If it does turn out that you need to block in an RCU callback, > queue_rcu_work() can be helpful. This schedules a workqueue from the RCU > callback, allowing the function passed to the preceding INIT_RCU_WORK() > to block. In this case we really should not block here. The problem is that we are hitting the strange bdi auto-unregister misfeature due to a bug elsewhere. Which reminds that I have a patch series to remove this auto unregistration which I need to bring bag once this is fixed. That being said queue_rcu_work would have been really useful in a few places I touched in that past.