Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2265287iob; Fri, 20 May 2022 05:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVW7M65gGDDwIAVHVUVEiJ0OBHV9Uj/3FvCSChp8eN8XPlkn0tuqeGix06wfF7u0s0KdE1 X-Received: by 2002:a63:9752:0:b0:3c6:5a7a:5bd6 with SMTP id d18-20020a639752000000b003c65a7a5bd6mr8572786pgo.390.1653051049099; Fri, 20 May 2022 05:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653051049; cv=none; d=google.com; s=arc-20160816; b=LYQBTJNqSDhix6NL+UbpJk35ubDsMtkGppJzUTgzwdJpVRJend4w3mUdWEZ2oOzoWn j9GWVkLAcWO0bdzyR52bJ4EXfDiFkWeot+qJXLwMXeEXQv82ADFJ4E7ETIz7smIWznGS Ctuh4LTXuyR3x2L0wvXfEl+ayoWPOFGax9VeacAxDPbOSn3aprYvZfOrRILDBfhWN4t4 TPrw8XPvzILhPnSyWXKQY74PZhPOZz6q/jmC+gH/F3rPz7QvJioYp9B53t9WZSVMvoj7 eVN1tjkxNJq2Jfp9iVcgLXJSVTZC3/rdNUnkYMaZGTM+Kff3JAC66eqjSFv5SIC7fjz+ gEkA== 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=/lPQYIoRU2uev649WIcZ/U8eDmQ8LvVgKqafkl+iHLg=; b=ZsmeMzD6ZF36aFjOSxs7ZLr0t60bYXDSKU19RETEo++sAZDE3ewJolqK8BTCdch4hm LzUJgjhDqSH6rhYYvy/hcbgenJCWdslbzmyFsolop5/33AKOtaShrmgQrzvggyRnAg4I SecnluF0w5+yZPCyzTq3X55J0Ja5//nokl/gUXKIVUKzozldWO73OSUYOkkO7u28feNi sikqhJNsmfeJrgQTYvHLnIUE4Kftj8KfNyyV90wkWtduTh98fNYYxXXItYmQlOMf86n6 gZGFSgvbMFa2DIhO0TxxaeDWSZQZI+nclN7KI2lbpZjDDmHuJIRmXWw2zEXDWYdLkZfO HqQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=DpI6S1tA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk16-20020a17090b225000b001cb7551c772si3445243pjb.163.2022.05.20.05.50.35; Fri, 20 May 2022 05:50:49 -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=@deltatee.com header.s=20200525 header.b=DpI6S1tA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244391AbiESTOD (ORCPT + 99 others); Thu, 19 May 2022 15:14:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244331AbiESTNZ (ORCPT ); Thu, 19 May 2022 15:13:25 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB439AF300; Thu, 19 May 2022 12:13:23 -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=/lPQYIoRU2uev649WIcZ/U8eDmQ8LvVgKqafkl+iHLg=; b=DpI6S1tAI7JENbM07q6U8cyqoq 0OQBL5AKmwL079/P8ff0T4iYVJtaf/3UoOFrvPWfXRWUhX0cD9UUKN/h9D/oAQ7Ep/wQcuWWWSqD1 IVk8QkQoHyqNVkmNZW/xRnYq4B5ZI5Wff4Ulpnro1SH6pFcEIeh1qLRB4g6zdlKhcGAcBFUskP/6X E2nmwM2VZuMT4tn6vJkv9Ofmqw2tDsbvnH1z3ajIRlx3hiuid0oTW22cnGckNGTDzsMN+ISpT59tI rKbrinmFq/8FVHXlBTNh6jXp6Fpz4Jq5ibXMyruQnitTaRQeCWcaQdVevs+abx1M0CargH8psgPoe BTSlXnjw==; 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 1nrlaJ-002TqT-CX; Thu, 19 May 2022 13:13:20 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1nrlaE-0004TY-Et; Thu, 19 May 2022 13:13:14 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Guoqing Jiang , Xiao Ni , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Thu, 19 May 2022 13:13:04 -0600 Message-Id: <20220519191311.17119-9-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220519191311.17119-1-logang@deltatee.com> References: <20220519191311.17119-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, guoqing.jiang@linux.dev, xni@redhat.com, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v1 08/15] 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 --- 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 cddc2c37d2c5..f7d013479a68 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -505,10 +505,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)); /* @@ -526,14 +525,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); @@ -552,7 +551,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); } } @@ -1282,7 +1281,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