Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2437107ioo; Sat, 28 May 2022 13:39:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfXVV2CJ8Ge3Trs+gq7H69dKwynOSLkDF43U4RsZAZw5SpBE6OcnQrqqlIG3WTML6Ou4iD X-Received: by 2002:a17:902:8698:b0:158:99d4:6256 with SMTP id g24-20020a170902869800b0015899d46256mr49995463plo.104.1653770375655; Sat, 28 May 2022 13:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653770375; cv=none; d=google.com; s=arc-20160816; b=fUNFPic8J2VI7bJZTfeEsIVWa62qEvspuGZAExXcEyuZ/HL+fiWFjGk1cJvmHrLCL1 Dt2Mz2ciw5QMx3VH8WD5tfs3rY7GsjOVb9jfYVNt5fLIPybIfxO5jafuMkqOOHfbn5CF k79pIOXXNSPKEfFEMjA6JErMkF4qfHr8BfVVxIwts7rb1HEKa1vKGcfu1UHFdiuWXhU/ ecBjVo9gK151+qWZ+3s6lvVFBe52LkEToLKf3KZ/aFmOrPKr6nEFrWa3S+w77ilTwh6S q2zbuSD7EX5nKQ9Dw4neHproWVyZ7Lnhu+YkKm/UeNpv4rMIv08HO/t/mHYQAdx5mK09 aL6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=EJp+9sZ34Y9fqOBjq+Gi6IuCQ2335JDwkpGO6bYI9Ak=; b=vLnvmyQAyTv4GKhFTw4dtDS3BwEws/mNtDkLp5L0UaeGf0pA/spaynsIvltAoFES6g Zm7Dh2xFexw3BFr6yP8owM0krwJu7oaoCp06fZdSf8XIkYipT/2CV+03BO49wYbxOLr3 vXK4oqVnqs7JAcKcBbDt4xMA4wSE5tON9hhLYGF3ISOS00Z1kK/Ddzt8dPgHCZX/b53K RRzoye6XJvh8QOzv0cGXD8dCczY0m3S6mmyUAjRjF/n4Wt2RB18xkY6GexgviHwszkZp 1rDmShuuyzzO5Io96l58pbEdQ995Kje4mJEW2v6FMwYXalthMB0JSPIUVUTpvPaI/Nqo TyEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=mn47hcEh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n19-20020a63e053000000b003fb8f6e341fsi9082964pgj.290.2022.05.28.13.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=mn47hcEh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2C3F6162F; Sat, 28 May 2022 12:41:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348261AbiEZQhI (ORCPT + 99 others); Thu, 26 May 2022 12:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346042AbiEZQge (ORCPT ); Thu, 26 May 2022 12:36:34 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0C884EDDF; Thu, 26 May 2022 09:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=EJp+9sZ34Y9fqOBjq+Gi6IuCQ2335JDwkpGO6bYI9Ak=; b=mn47hcEhuA7bfg8fQQdfCen6LP 2RY8KUU6xyftTpn8x/YD+1VI832dC8ieoNAOk4oOqYF50OwBaGMBxQDvBpcJxzpVzSuulK1wQWLuo 0I6K8zQtl6I2SzfGlPK090pwUO4ZoK8ky3WD93/sLM2/DzEKPBJfJNi7T0XyaFwU7ZbX3O+QsxQ7H JZJYYsD9OXB/kmejfwat+D0sH0KqojULRWSdwL/LAHBAvCprw8GFhVHYZquXZPJ3chXgRwdVJe2mc oMxeYQzePKmXHfk7U309Ujw9cwatN0Hemv0aUbLl0cxdC5LTYDiGi2PvCFaGPQyIltfXtjddlxfpl lVDEgkDQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nuGTG-008A7R-NR; Thu, 26 May 2022 10:36:23 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nuGT9-0008XS-4f; Thu, 26 May 2022 10:36:15 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Donald Buczek , Guoqing Jiang , Xiao Ni , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe , Christoph Hellwig Date: Thu, 26 May 2022 10:35:55 -0600 Message-Id: <20220526163604.32736-9-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220526163604.32736-1-logang@deltatee.com> References: <20220526163604.32736-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, buczek@molgen.mpg.de, guoqing.jiang@linux.dev, xni@redhat.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, hch@lst.de X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Subject: [PATCH v2 08/17] md/raid5-cache: Pass the log through to r5c_finish_cache_stripe() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org r5c_finish_cache_stripe() dereferences conf->log, which will need an rcu_read_lock(). But that is not necessary here as the log is already available in the call sites through other means. No functional changes intended. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig --- drivers/md/raid5-cache.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 24110b687055..8284ce3e5cf6 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -507,10 +507,9 @@ static void r5c_handle_parity_cached(struct stripe_head *sh) * Setting proper flags after writing (or flushing) data and/or parity to the * log device. This is called from r5l_log_endio() or r5l_log_flush_endio(). */ -static void r5c_finish_cache_stripe(struct stripe_head *sh) +static void r5c_finish_cache_stripe(struct r5l_log *log, + struct stripe_head *sh) { - struct r5l_log *log = sh->raid_conf->log; - if (log->r5c_journal_mode == R5C_JOURNAL_MODE_WRITE_THROUGH) { BUG_ON(test_bit(STRIPE_R5C_CACHING, &sh->state)); /* @@ -528,14 +527,14 @@ static void r5c_finish_cache_stripe(struct stripe_head *sh) } } -static void r5l_io_run_stripes(struct r5l_io_unit *io) +static void r5l_io_run_stripes(struct r5l_log *log, struct r5l_io_unit *io) { struct stripe_head *sh, *next; list_for_each_entry_safe(sh, next, &io->stripe_list, log_list) { list_del_init(&sh->log_list); - r5c_finish_cache_stripe(sh); + r5c_finish_cache_stripe(log, sh); set_bit(STRIPE_HANDLE, &sh->state); raid5_release_stripe(sh); @@ -554,7 +553,7 @@ static void r5l_log_run_stripes(struct r5l_log *log) break; list_move_tail(&io->log_sibling, &log->finished_ios); - r5l_io_run_stripes(io); + r5l_io_run_stripes(log, io); } } @@ -1284,7 +1283,7 @@ static void r5l_log_flush_endio(struct bio *bio) spin_lock_irqsave(&log->io_list_lock, flags); list_for_each_entry(io, &log->flushing_ios, log_sibling) - r5l_io_run_stripes(io); + r5l_io_run_stripes(log, io); list_splice_tail_init(&log->flushing_ios, &log->finished_ios); spin_unlock_irqrestore(&log->io_list_lock, flags); -- 2.30.2