Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp843856rdg; Fri, 13 Oct 2023 02:58:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoQSVjqXD0dcUEwz0EdspcU4YhUicDk7Q/vPhdYhnLp0L1z6+SMn+O6zD0WyL87FB+xbbQ X-Received: by 2002:a05:6870:9a04:b0:1ba:ddf2:417f with SMTP id fo4-20020a0568709a0400b001baddf2417fmr28762284oab.2.1697191085503; Fri, 13 Oct 2023 02:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697191085; cv=none; d=google.com; s=arc-20160816; b=Xa6uVXvHQHzfTOby/7o9KiU21FFZIceIeGMAbHBv4Mrc2agdfHkGvwUtfsJejVfMAj AF/wLSsUboXIjPeIrVWa0kOP7xldYLmPuojQ4i7WrEgjVSIF9Va9bBVBXfWhZ6Wjmpww XlsYp4wn5vsxx/MYLD9Tni1eWjLD5vRVpvG3h7NQ2R+S3DPAWwGX4P6ZmyeDY40RYawG gQv87A5JB0+BP71r7ttW+T+kpxmfnVecZc60uQNmpl+WJ2ErGCHlQJB9aGH7ARj+rMZ4 NiMe8XOh/8RTdLQlwsJSf2n5wp3HXf+XTw3oIoQeUVwzPYok4d0ndXHGKGUtdqz91tNp ilZw== 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 :message-id:subject:cc:to:from:date; bh=4l/IQOCubAp8o6lMvK1TyHqd2m5ULS05C8pz3jtBCvE=; fh=bEdNJka57DzC+WWO1KimgAYDb8ct/by22YkeLDxzATg=; b=OitEkhEUyAgWMJ8RyUj5xoPGAUPIdYMIn2jJ9PjhaqVm8k2NG0C7KJBTjssHjc8Yeu /5CmrxBAu1DSoG7BM64L6/2EBqb09SWGxAu2AjHEKLuqRWB/AqRtGKRYe4Fm0iqzuzob P8yLXdo3R8OTLXw5STJRWmerg6TjngaVIhNmgPf24L4nC7S8/lV265zF5KS/gePH7uHc Kkq3ENoCPSfKAKq1XANW8JC51td6HSv0zJKe+HjA+RilPJ/dzlXdevp4tlzSUJAJNqDG RouCAFj8EiLooU6vNKknnlo2+tT6tls0D6gLEaQyrTujY07+Ti98+fJ7v20vHnJpQuu5 74Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j6-20020a633c06000000b005aa0e7d39f4si1626362pga.733.2023.10.13.02.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C92BE839D9EF; Fri, 13 Oct 2023 02:58:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbjJMJ56 (ORCPT + 99 others); Fri, 13 Oct 2023 05:57:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjJMJ55 (ORCPT ); Fri, 13 Oct 2023 05:57:57 -0400 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B515CCA; Fri, 13 Oct 2023 02:57:52 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qrEvK-006ijp-3e; Fri, 13 Oct 2023 17:57:39 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 13 Oct 2023 17:57:42 +0800 Date: Fri, 13 Oct 2023 17:57:42 +0800 From: Herbert Xu To: Wang Jinchao Cc: steffen.klassert@secunet.com, daniel.m.jordan@oracle.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, stone.xulei@xfusion.com Subject: Re: [PATCH v3] Fixes: 07928d9bfc81 ("padata: Remove broken queue flushing") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Newsgroups: apana.lists.os.linux.cryptoapi,apana.lists.os.linux.kernel X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:58:01 -0700 (PDT) Wang Jinchao wrote: > > diff --git a/kernel/padata.c b/kernel/padata.c > index 222d60195de6..79d04a97ded6 100644 > --- a/kernel/padata.c > +++ b/kernel/padata.c > @@ -1102,12 +1102,16 @@ EXPORT_SYMBOL(padata_alloc_shell); > */ > void padata_free_shell(struct padata_shell *ps) > { > + struct parallel_data *pd; > + > if (!ps) > return; > > mutex_lock(&ps->pinst->lock); > list_del(&ps->list); > - padata_free_pd(rcu_dereference_protected(ps->pd, 1)); > + pd = rcu_dereference_protected(ps->pd, 1); > + if (refcount_dec_and_test(&pd->refcnt)) > + padata_free_pd(rcu_dereference_protected(ps->pd, 1)); Why is this dereferencing ps->pd again after the refcount_dec_and_test? If this is necessary please explain it in the code because it is not at all obvious. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt