Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp9485796ioo; Sun, 5 Jun 2022 16:02:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy703KO1YeAvpXqZZLBCg3//NHvKCAjrDVCHLFtVaBSWtVXjRw6x/6y28ILsIq371lsiTrb X-Received: by 2002:a17:907:7207:b0:6ff:d25:ee3f with SMTP id dr7-20020a170907720700b006ff0d25ee3fmr19126134ejc.389.1654470140501; Sun, 05 Jun 2022 16:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654470140; cv=none; d=google.com; s=arc-20160816; b=CDjcYk6PYkBe2Rhm28PFXoYBN40WthO0gzBqV/rNOR0bz/i1T0s9FDaV/5behb8Knv vymjBLEGtjyoTRGBK3IvKzDQuLbV8Vewu5sPKsnd2XyfTJygOoZot5p3P+5nA7bmOKZU m0xvnkCQvuQkYZmKHRskOsbsP2MYuCsd3kmhOhKgOvYTKv2x8Lz/7uLyDBLpvjO2jxf+ 3ip+5s2R3KsR/E92z+a4xfYJyiBvkXmyM34ftze//mxI3XSrTi/ImySxA7z/0V1HoMUh 7K+6hMLwNFHZAwKIzS8KMw5KUB0kZ8RkOdtw52r6CZuw2JP3C288Ld8dfcYMrmLD0dsI dFXg== 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=/qB9gxrKGTNOzMJzvvVbgCLr/R5FGBh4VoOWfCq44ZQ=; b=hLX0wJnosZ0TlICBYaRxnBf4pTsxfQwpCCjU8HLyJj4tYuKXoNwQxYObigcK1U9+T+ YqnEgUCi0uoBBSqd9CQptyFxpsO2Kk+U2q81wbExusEO0bvEJMksAcUl5wqagOD44xDE PpZnNwvY4QAwz+2Wv6EfMUrwJjNf2nKJ16rhBUZZWczio+/CUVF1hksi21sKnTsMZuG+ eBnrViyulHfSRFf/xMNz1Wc2TnnHsECnm0PtkDE4J69skpr2Gsrd8tnrNqqg2INZD2bY pUIYZLv4nbA6hvXjgxnvsxyd83F4LC8IsDsVz9VFVNOdIYW816okrCDO9rf4PNZe+2OV PgRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="KRj+Ey/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a05640226c800b0042b5724a3bcsi16371485edd.21.2022.06.05.16.01.55; Sun, 05 Jun 2022 16:02:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="KRj+Ey/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241645AbiFCGkP (ORCPT + 99 others); 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.