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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD1F7C433EF for ; Fri, 25 Mar 2022 16:49:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245042AbiCYQuy (ORCPT ); Fri, 25 Mar 2022 12:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355060AbiCYQuy (ORCPT ); Fri, 25 Mar 2022 12:50:54 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E7D3BF53C for ; Fri, 25 Mar 2022 09:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=Q5XEgUtW8BAa3ty5tfm9QFPQ3EyBbqzLVH+Voto8vDU=; b=lCGXwCAkt3w5f+MS266D8no0kf kcEwzFkB2+YeSHaDn0xIgzMAtjQIts4FjD8zfxzUHa8lf51cZa4mbR4aa7YvH6P1yig0l01d7PoAZ JBL04VWKIBODgC0OsFTs9HirW/vRAbK91Z/z1KamRiYqFAISvqp8uUtWtClaAOUH31RRXDQHaIgaI MiRzDv8Sk8hfCyjepdb8qxuA2/nwD8BKmhYb0HDF6Frfsnz3JWXHjH62AciogxXr9vq2QGHezDJXn f3edKzlRaTFfZ9ENF/FeHFj0j7A3VQltfneEx3y2E8fCabvCWjsObUxyjRvZn+oZRtbzFg1zHNnnu k54/89ow==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nXn7n-002dgl-OJ; Fri, 25 Mar 2022 16:49:19 +0000 Date: Fri, 25 Mar 2022 09:49:19 -0700 From: Christoph Hellwig To: Niels Dossche Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, Alexander Viro Subject: Re: [PATCH] fs/dcache: use write lock in the fallback instead of read lock Message-ID: References: <20220325155804.10811-1-dossche.niels@gmail.com> <814c6a67-0fa4-862c-c98e-0e3e77cee4c1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <814c6a67-0fa4-862c-c98e-0e3e77cee4c1@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Mar 25, 2022 at 05:48:43PM +0100, Niels Dossche wrote: > >> - WARN(down_read_trylock(&sb->s_umount), "s_umount should've been locked"); > >> + WARN(down_write_trylock(&sb->s_umount), "s_umount should've been locked"); > > > > This really should be a lockdep_assert_held_write() instead. > > That's probably a bit nicer indeed. > I can write up a patch that does a lockdep_assert_held_write() if you want. I would much prefer that.