Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1827481rwb; Wed, 26 Jul 2023 20:27:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlGOVUJtYlw9HjASayCwk0rfqmh55/O5MIF9wPbTyiffttjvWj/nl2FMcHSN/fSz1fAYQf0b X-Received: by 2002:a05:6a21:7982:b0:13a:dbc1:16d5 with SMTP id bh2-20020a056a21798200b0013adbc116d5mr3577480pzc.42.1690428451330; Wed, 26 Jul 2023 20:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690428451; cv=none; d=google.com; s=arc-20160816; b=rcSK1/XsWwnN9SVwZtTXQ2zL4Vs0IAyn+7M3O8xyvfgk6Bb9uHVEmfFwWw33MyGgij FmhRoEh4keNJm+lI+pViv40HMPxAJN6ZaXjwoyyIGxeEPdTuKnJ27HosYI6RcFGfXYGp VvDul78CTRynHhTbBA8R9FhezKp9zgdr2FJNcIFEYF5eQ2ORQqwi0cv6h0ll4o3tcKo9 STdSxVDAbqUKvOJynLpkCPechylbNALXntESFoNxxJYmQPRbPiQVyoOBcXdlQPqmuqwd jxW2G5Wl3omknLCkxwjYbEAiHUDtJSNMX8NLeWAsvPhGPvm7XOPlvnyWzugh8t2B7nNz GW0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=2/oHz7SF+qwhqvee7uyeb/W9ByFEOLluyp4QtOuQF0c=; fh=AQg5rUUQgaOX9JPRLJ+xk4oz4OicdTCwyDhpMqoGdm8=; b=B67F8jamBgRpCLGjL9odf1b1yz59FGP56iR8ENTjcm/Cz/xCBHJcN2vHp0IQArZyDz 4K7a97zibF0D6iAVmJHgU4uFIfJAq+UH3X8wavSSdS3DJhcC5HCxITlYIrluTnGxdo+t 6Si1f80ZU6R1++4swGl3/2fYuPTmplOE60gTSeRSN4sxoUmiGj0/rXHPtSpljWjcF9BK 5aWHNNoMsootuITciOdMrJsdwzQuAVng16UWfXEEOBhyROpeab2MGTcLcYsih0VbJGQE 0uBF1QewB2Jg++B43ZY7UERi8aeq6fMd9EGjyRjQB7p8Q13JX7jaDcq7tqmDAV+FBkc1 i15Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=auwRtS+n; 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 d1-20020a170902cec100b001bb1d822685si456582plg.358.2023.07.26.20.27.18; Wed, 26 Jul 2023 20:27:31 -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=@joelfernandes.org header.s=google header.b=auwRtS+n; 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 S229686AbjG0DEK (ORCPT + 99 others); Wed, 26 Jul 2023 23:04:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbjG0DEI (ORCPT ); Wed, 26 Jul 2023 23:04:08 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F021BF2 for ; Wed, 26 Jul 2023 20:04:07 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7656652da3cso42786885a.1 for ; Wed, 26 Jul 2023 20:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1690427046; x=1691031846; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=2/oHz7SF+qwhqvee7uyeb/W9ByFEOLluyp4QtOuQF0c=; b=auwRtS+nCYvKPYlB9gt4rmjiPJplX/Wxv7LXJaMQF1Pobzrz/a2b0k/2jVu6c2MNlU vJAXF372FjA9k6ztO9uvdHqdv4/IJD6Y3BB/3KReMvoa8uf91X6zlPTgW8fKa4YCS+U4 jaxmph1g8niylOTrLnegFMXnhpLUUFFdcOi+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690427046; x=1691031846; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2/oHz7SF+qwhqvee7uyeb/W9ByFEOLluyp4QtOuQF0c=; b=NlSkyIxjWB1Q4KW23OT3ZWjV60NzMX+YjXMUKGKuCOqAA+6GFNPcdBCcVTYkqo0Oc3 KvAb4WdG/RD/CVIYB0uDamkPyTqB2sYsuyV8hvfPUbtSJHdJ2PanyAkgglM4QglLj4nE fq/c30fl3P9T4LYPomKHStFN9ZvmRCyyTamx+TrctrPiyGhp3ph4U/G5y+9yEvl3WKD4 Lqj1FGQG/sHqjZgrI+hKDJnhxtGlzPQ38fMv/+zwyv3lMAlyHLh5P9adduSA/DqG4hgE TnG0WfcSqY0p6HIs9oTbbT4AZVOSNRRTY8k8U9BfKrBAjFo9m1mcbZzYFSpWVj+I2ubq doIw== X-Gm-Message-State: ABy/qLagopIpSy20gW6/JxN5gD7PFBESe3IR6iVpEq+iCv5exFHqMczr wHSwamsA/Gp8z9ADq/baWsOq7FiCDZNRe0UdZqE= X-Received: by 2002:a05:620a:29ce:b0:768:11ff:7899 with SMTP id s14-20020a05620a29ce00b0076811ff7899mr5034967qkp.64.1690427046480; Wed, 26 Jul 2023 20:04:06 -0700 (PDT) Received: from [192.168.0.198] (c-98-249-43-138.hsd1.va.comcast.net. [98.249.43.138]) by smtp.gmail.com with ESMTPSA id u4-20020ae9c004000000b00767d2870e39sm114658qkk.41.2023.07.26.20.04.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jul 2023 20:04:05 -0700 (PDT) Message-ID: Date: Wed, 26 Jul 2023 23:04:04 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 2/5] srcu: Fix error handling in init_srcu_struct_fields() To: paulmck@kernel.org Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , "open list:SLEEPABLE READ-COPY UPDATE (SRCU)" References: <20230725232913.2981357-1-joel@joelfernandes.org> <20230725232913.2981357-3-joel@joelfernandes.org> <1943e34c-3c8e-411c-a677-33f8c5b4b0e5@paulmck-laptop> Content-Language: en-US From: Joel Fernandes In-Reply-To: <1943e34c-3c8e-411c-a677-33f8c5b4b0e5@paulmck-laptop> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 7/26/23 17:07, Paul E. McKenney wrote: >> - free_percpu(ssp->sda); >> - ssp->sda = NULL; >> - kfree(ssp->srcu_sup); >> - return -ENOMEM; >> - } >> - } else { >> + if (!init_srcu_struct_nodes(ssp, GFP_ATOMIC)) >> + goto err_free_sda; >> + else >> WRITE_ONCE(ssp->srcu_sup->srcu_size_state, SRCU_SIZE_BIG); > Given that the "then" clause is a goto, what is the "else" clause doing > for us? > Not much. Agreed we can get rid of "else" and reduce indent of the WRITE_ONCE that follows. Would you mind making this fixup in the patch for your apply, or would you like me to refresh the patch? Let me know either way, thank you! - Joel