Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2168272pxu; Sun, 6 Dec 2020 22:10:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlbTFTuHyehWYh+qWTaMxuGr8Nngxu4glXFBAybekmgpVNnW7OCBACkmzycGGesbZmPE6F X-Received: by 2002:a50:875b:: with SMTP id 27mr18690036edv.24.1607321410593; Sun, 06 Dec 2020 22:10:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607321410; cv=none; d=google.com; s=arc-20160816; b=pATbAuJnqaPqYHjb+yBVw6iw5x0u2Kx5cqo1stAObVyYdzs2og9p/yX11ZoBm6+5nX LBP2eoobG3qtiR8tcA3qvmXjNwbFRLD7lOb2HyP8qNr7mJcHy9tBtRgpOoQxIsqP55Rk 37Ms3NiiwpMxhq9Tv2KxszX08zZJsZ/IQ+iZi8vlFvjqq7rJmnpG1AVp7liWwp3k+FxL pDdokm0HFZbZP5lYRkikwDrMqfHdBZ5eApSB7HVbeAS6z5lJTf2hsxeRf9GQs54i2JhL nprIQb8y7mog88UnzZAAxn/DhwLoL1PBTXfXCSyrgzSmKsUS3ejHq5XjzSEEFQeC1FCx ePtw== 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:dkim-signature; bh=jJe1mZNNS4VmFa6XZxq6kbSRFlAAblrXazBVNO87E0U=; b=1Ay9HTpmw2alJnhQfhrUZDU4Fif4vZgdieJycOO9iU25s5I0mHcjXbWd5H5T5DBepD x2ZdNuu22x/t1F+fvEeSCmw6v3a+srLj6tgxv2zNTNvEBycfwZrp+A2IcsLSDeUAJJq+ HCuIjnC1cV1FCQ9QBxih9q5n6m1Xo1BiIJJ4Y6rWnSH7yivDcOVnk1t3n2m74sw4SqAV ykDYI9X4hPh56vISCldORtEhvBKWg1mpdECZaEi4h9bjfJEWyFZqc+7o8MuVJhbeuv0C tx7iQwdw1KQtbg7tFomDaFKUWb4whYQP4EtfDvNUu12dqwm66VlpJ+rQT5PXs2mZNImV z8rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uN5tH5kZ; 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 t17si5788181eji.269.2020.12.06.22.09.48; Sun, 06 Dec 2020 22:10:10 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uN5tH5kZ; 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 S1725888AbgLGGIa (ORCPT + 99 others); Mon, 7 Dec 2020 01:08:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbgLGGIa (ORCPT ); Mon, 7 Dec 2020 01:08:30 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D04DBC0613D0; Sun, 6 Dec 2020 22:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jJe1mZNNS4VmFa6XZxq6kbSRFlAAblrXazBVNO87E0U=; b=uN5tH5kZw1K13G/E9Ga8+uktt3 ts6DuozVOImyfrqe7ZbFH9UIlsJ1pOWlNLmrfTeRnEvHZrwdJcrNh7Oh2fbBfXo/kqBubai81Zygb 01SmeyQ8aSyfKdmdaNBBu30vhz3qGRnVhkCbZghBVObne4ohs37JkIwLXT7zbgZtyfKLJ0AVxaFer 8wdPVS+bjhAqd33n8qu5AeaEm75yyFxB9ypSW0I8Xl12VL2qTeHUxSPov3u94X/ZPNeue5C5V7rKl ZFiwsvECSXsn5c3XE9lpXgYiaUPa7rI3g2G7XR18Qoqzp0Lo87vqhrqwehz3Tnx8XCN39AFoeFSmt sDAI8h6Q==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1km9gZ-0004NJ-05; Mon, 07 Dec 2020 06:07:47 +0000 Date: Mon, 7 Dec 2020 06:07:46 +0000 From: Matthew Wilcox To: Naresh Kamboju Cc: linux-stable , open list , linux-fsdevel@vger.kernel.org, rcu@vger.kernel.org, lkft-triage@lists.linaro.org, Alexander Viro , "Paul E. McKenney" , Peter Zijlstra , Greg Kroah-Hartman , Sasha Levin , Thomas Gleixner , Miquel Raynal , Mark Rutland Subject: Re: WARNING: bad unlock balance detected! - mkfs.ext4/426 is trying to release lock (rcu_read_lock) Message-ID: <20201207060746.GT11935@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 07, 2020 at 11:17:29AM +0530, Naresh Kamboju wrote: > While running "mkfs -t ext4" on arm64 juno-r2 device connected with SSD drive > the following kernel warning reported on stable rc 5.9.13-rc1 kernel. > > Steps to reproduce: > ------------------ > # boot arm64 Juno-r2 device with stable-rc 5.9.13-rc1. > # Connect SSD drive > # Format the file system ext4 type > mkfs -t ext4 > # you will notice this warning Does it happen easily? Can you bisect? > Crash log: > -------------- > Writing superblocks and filesystem accounting information: 0/895 > [ 86.131095] > [ 86.132592] ===================================== > [ 86.137300] WARNING: bad unlock balance detected! > [ 86.142012] 5.9.13-rc1 #1 Not tainted > [ 86.145675] ------------------------------------- > [ 86.150384] mkfs.ext4/426 is trying to release lock (rcu_read_lock) at: > [ 86.157020] [] blk_queue_exit+0xcc/0x1b0 > [ 86.162511] but there are no more locks to release! This really doesn't make much sense. blk_queue_exit() in 5.9.12 does: percpu_ref_put(&q->q_usage_counter); (literally, that's the entire function) percpu_ref_put() does: rcu_read_lock(); if (__ref_is_percpu(ref, &percpu_count)) this_cpu_sub(*percpu_count, nr); else if (unlikely(atomic_long_sub_and_test(nr, &ref->count))) ref->release(ref); rcu_read_unlock(); Unless ->release() has an unbalanced rcu_read_unlock(), there definitely is a lock to release! Some archaeology says that ->release is blk_queue_usage_counter_release(), which calls wake_up_all(&q->mq_freeze_wq); which doesn't appear to use RCU at all. So this trace makes no sense, and all I can do is ask you to bisect it.