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 A8CE6C433FE for ; Mon, 18 Oct 2021 07:21:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4147E61356 for ; Mon, 18 Oct 2021 07:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4147E61356 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id AB55F900002; Mon, 18 Oct 2021 03:21:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A3E296B0071; Mon, 18 Oct 2021 03:21:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DE74900002; Mon, 18 Oct 2021 03:21:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id 7B5E46B006C for ; Mon, 18 Oct 2021 03:21:23 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3DE4B26834 for ; Mon, 18 Oct 2021 07:21:23 +0000 (UTC) X-FDA: 78708712446.08.DF547E8 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf27.hostedemail.com (Postfix) with ESMTP id BCE14700009D for ; Mon, 18 Oct 2021 07:21:21 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id 187so14001758pfc.10 for ; Mon, 18 Oct 2021 00:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Waoh7FE62gxhLg87Tgkd+4LHcbVYAyUliQvnhrotbxk=; b=h4Tbs5GvBbuRfGr031ZMbAh5DaUTySUYg1xnPJHqeG/ba3Il2EMzR1KHM/VEvPIJBF ExTWoneFMhPcjf4ivjM4DUOlzBefb2SDn33Dm8oA0mQ3178xoHSIDJvPry2EZZBtVL5v R8nSsQx+OLYn33P/yjqTgiAvYkN7uBZ9vvmb0HANUrQzTEiA568sD8aswZrWndnZe4hT 1qlxBN3B/z/gTOrH89uP93yM+Aw4dgNMe9H7VV7YIogeV2GFIIIL51nHEE3RQItOD+vN 6BHYqPegdAOh7eJVA8RrwTjao4YO678CKjWEntvMb1LzTPRVTUb8SqLtYcwGGoaD5UeR NlBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Waoh7FE62gxhLg87Tgkd+4LHcbVYAyUliQvnhrotbxk=; b=zv9GuwKcgyCEx44qkcOVAfIZ7P69LTMJDangZ0J6g4LHJwE8qq5zKHVFhFqFv1Z8Um lFhNpqmw3f5bqyHDYm162+F1l9fjijt7PG6XdKJAGNYqPeHcfAuPfvYihG2OZnYmYJOn AjGOrIDO3aA8UJNVSj+dmehPkdcjhwQCBuvpjjBwKvADXKfKM0w9J+uTEt8ycBMij3dL 0KmiwZesOG7kSy92ap3/Pota3tH5JFuLxCHSfhNbDeRXDofuWXsp9CY6YLE4EYTjf8az 6mRwrQq7SwahvBP0CdNCAFGcnKZa7BMmoRKkqx0Yk3Hb+BcqadsdjJ+rYmQV8kDESGir NIrA== X-Gm-Message-State: AOAM532qD685YTByMmt+6EGOI/mmElUclQS1ZS9EghgSsv/RZFISTPFN Tij32w0NsfOcHBYlHuuiGpE= X-Google-Smtp-Source: ABdhPJw3nU8/N+oGHEw8P2MVDpVsZS7A/mRkIbKeU6e5yjmfYYJ/kOxxZLj371LVxAAnOvb/+rPL7w== X-Received: by 2002:aa7:83d1:0:b0:44c:654a:be1d with SMTP id j17-20020aa783d1000000b0044c654abe1dmr26871180pfn.68.1634541681824; Mon, 18 Oct 2021 00:21:21 -0700 (PDT) Received: from [172.18.2.138] ([137.59.101.13]) by smtp.gmail.com with ESMTPSA id 17sm12101171pgr.10.2021.10.18.00.21.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 00:21:21 -0700 (PDT) Subject: Re: WARNING in __init_work To: Christoph Hellwig Cc: Hao Sun , Hillf Danton , hch@infradead.org, willy@infradead.org, Linux MM , Linux Kernel Mailing List , syzkaller-bugs@googlegroups.com References: <20210907074432.3711-1-hdanton@sina.com> <20211018044745.GA23657@lst.de> From: Zqiang Message-ID: Date: Mon, 18 Oct 2021 15:21:18 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20211018044745.GA23657@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BCE14700009D X-Stat-Signature: 38i1p6qiru6h77ixpudwukg7ojj8c6jt Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=h4Tbs5Gv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of qiang.zhang1211@gmail.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=qiang.zhang1211@gmail.com X-HE-Tag: 1634541681-859 Content-Transfer-Encoding: quoted-printable 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 2021/10/18 =E4=B8=8B=E5=8D=8812:47, Christoph Hellwig wrote: > > On Mon, Oct 18, 2021 at 12:43:38PM +0800, Zqiang wrote: >> This is the details of the test, Hope it helps you > Call me stupid, but I can only find the trace and linked to unreadable > google sites that wan't me to log in somehow and no actual details. > > If you have a direct link to the reproducer (an attachment would do > it as well) I'd love to try it myself. > > Otherwise this commit in the block-5.15 tree should help to catch what > I suspect is the root cause (final ref drop before unregister) earlier > and with a better backtrace: > > https://git.kernel.dk/cgit/linux-block/commit/?h=3Dblock-5.15&id=3Da204= 17611b98e12a724e5c828c472ea16990b71f I found the following calltrace Call Trace: [=C2=A0 326.460593][T27634]=C2=A0 dump_stack_lvl+0x8d/0xcf [=C2=A0 326.461773][T27634]=C2=A0 should_fail+0x13c/0x160 [=C2=A0 326.462921][T27634]=C2=A0 should_failslab+0x5/0x10 [=C2=A0 326.464038][T27634] slab_pre_alloc_hook.constprop.100+0x4e/0xc0 [=C2=A0 326.466040][T27634]=C2=A0 kmem_cache_alloc+0x44/0x2a0 [=C2=A0 326.466921][T27634]=C2=A0 __kernfs_new_node+0x68/0x350 [=C2=A0 326.469602][T27634]=C2=A0 kernfs_new_node+0x5a/0x90 [=C2=A0 326.470441][T27634]=C2=A0 __kernfs_create_file+0x56/0x150 [=C2=A0 326.471386][T27634]=C2=A0 sysfs_add_file_mode_ns+0xe6/0x290 [=C2=A0 326.472358][T27634]=C2=A0 internal_create_group+0x186/0x4e0 [=C2=A0 326.473331][T27634]=C2=A0 internal_create_groups.part.4+0x4d/0xb0 [=C2=A0 326.474288][T27634]=C2=A0 sysfs_create_groups+0x28/0x40 [=C2=A0 326.474918][T27634]=C2=A0 device_add+0x4c3/0xc60 [=C2=A0 326.476286][T27634]=C2=A0 add_partition+0x262/0x450 [=C2=A0 326.476919][T27634]=C2=A0 bdev_disk_changed+0x3ec/0x800 [=C2=A0 326.477615][T27634]=C2=A0 loop_reread_partitions+0x2d/0x70 [=C2=A0 326.478515][T27634]=C2=A0 loop_set_status+0x274/0x320 [=C2=A0 326.479373][T27634]=C2=A0 lo_ioctl+0x392/0x920 [=C2=A0 326.481271][T27634]=C2=A0 blkdev_ioctl+0x2ff/0x370 [=C2=A0 326.482438][T27634]=C2=A0 block_ioctl+0x55/0x70 [=C2=A0 326.483605][T27634]=C2=A0 __x64_sys_ioctl+0xb6/0x100 [=C2=A0 326.484241][T27634]=C2=A0 do_syscall_64+0x34/0xb0 [=C2=A0 326.484843][T27634]=C2=A0 entry_SYSCALL_64_after_hwframe+0x44/0xa= e I find in add_partition(),=C2=A0 if the device_add() return error, we wil= l=20 drop disk object reference count, but i find put_device(pdev) (will call part_release())and=20 put_disk(disk), both will reduce the reference of the disk object ,=20 however we call get_device(disk_to_dev(disk)) only once or Did I miss something and didn't analyze it=EF=BC=9F Thanks Zqiang