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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97539C433EF for ; Fri, 3 Jun 2022 06:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241641AbiFCGkP (ORCPT ); Fri, 3 Jun 2022 02:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241628AbiFCGj6 (ORCPT ); Fri, 3 Jun 2022 02:39:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7999538787; Thu, 2 Jun 2022 23:39:57 -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=/qB9gxrKGTNOzMJzvvVbgCLr/R5FGBh4VoOWfCq44ZQ=; b=KRj+Ey/Rr2SB20Q1D3iuLZQ1Hy IAK3MTi6/6h4lRiBTkT2Thew6/Qcuen9go+KyDHYEi3H4bUQbnZLvkvoPNoj374nfMu5b0iTxJX2o YxVAicmeaTegJg8GB7ovR3749ztwgYXnxNhsegHrStiYUaAp1+bIHLuBwAGL7tpuJkWiepuizANCh Z3b/WtbCv8Kx1mESKwIkG09wIvEeTXyYahyF62A/0+arRwhbd90u+YwXebhS30M0KQsPE8EAYd7Yd 12YWe8dyZqrZg7UnPnq9XEslJkaSoq07sRx9v2whhK/RWO4mZ3vEHLYfIElplYV6L5MS7ZyaJ6HB4 FQ2ZayNQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx0yO-0063An-Gv; Fri, 03 Jun 2022 06:39:52 +0000 Date: Thu, 2 Jun 2022 23:39:52 -0700 From: Christoph Hellwig To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu , Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Stephen Bates , Martin Oliveira , David Sloan Subject: Re: [PATCH v3 04/11] md/raid5-cache: Take mddev_lock in r5c_journal_mode_show() Message-ID: References: <20220602181818.50729-1-logang@deltatee.com> <20220602181818.50729-5-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220602181818.50729-5-logang@deltatee.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-raid@vger.kernel.org On Thu, Jun 02, 2022 at 12:18:10PM -0600, Logan Gunthorpe wrote: > conf = mddev->private; > if (!conf || !conf->log) { > - spin_unlock(&mddev->lock); > + mddev_unlock(mddev); > return 0; > } > > @@ -2557,7 +2560,7 @@ static ssize_t r5c_journal_mode_show(struct mddev *mddev, char *page) > default: > ret = 0; > } > - spin_unlock(&mddev->lock); > + mddev_unlock(mddev); > return ret; Using a goto out_unlock would be nice here to keep the critical sections simple. But even as-is this looks good: Reviewed-by: Christoph Hellwig > + lockdep_assert_held(&conf->mddev->reconfig_mutex); > + .. but this looks unrelated and misplaced in this patch.