Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2916776ybj; Mon, 23 Sep 2019 11:30:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbm+7Y7JjwbX8FPmtb6/1wZz6GWP/NQpDqWlN8sJD0LFdgbWVxdS6JxfJ1JRvHH6SUbqHT X-Received: by 2002:a50:cc43:: with SMTP id n3mr1594793edi.250.1569263438860; Mon, 23 Sep 2019 11:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569263438; cv=none; d=google.com; s=arc-20160816; b=jlE3tz1RJnC4VjSxDYATV/yndg1/Mnn+CldVvmbqzVT5YsXnF+djo1uCYY5Tx6DoMV K4gZ7WRx5BbrVQc0UZFhDM+Uhsy28Qzww3UfztevDZRZg2D1hW580ICvh8RTISxFPvWb koaomGs8MbYABTAZHn3Ln/My5DSdnaB2F9b7j5YPQXKb4pH7YFChtoKmFDIOxPqt+JKC EEZL1RqeTY91VNciXR4ok/vke/GCz+esUsm/MQBDvCpeGNpVaa4N+m6f9i4JX53KmiA8 wgn2LR0eOjanLOXGcio7qoEucC1H2aSpaDliR7ULqhGwkvE5rFc84MS/zvAdaWSueQI9 8W8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1InDKizWAmC4UmgemZa8qt/CsiKFdfsuJTO8ZaTMBfc=; b=J7x6ETQKApED7SIweSh9L/GxK8VRtRXUzVGXw8cN8ZKC7U4lE5GqsKko2kGrJLhFuA Uini3ji638eDWxZtTX8mMGDAK8PPf287Zxhn0rKknEOyi89K4lmwy//itK7fhIuKJtWV I96sbgLjCTXDxDEekQ5gU5VU6CgoI0+uoPO2zSPv9fBApYenpNn2mRr07l0bcDJd2AAx p7OLpvP4LX0DTKm+2FTG/RIekAH70ZpPkCbAebkIffb1v3c248Zp5Z6yw4a+SuoERjuR 7Wx8KtvlvsdFBVi+ZTwPtu1Eu1RrMMCRuRT9f3jHypXDvNMKobfUFu/2k6NJmjCXGXVr aHqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zTWX4XAx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f47si7216810ede.263.2019.09.23.11.30.15; Mon, 23 Sep 2019 11:30:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zTWX4XAx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727967AbfIVIaI (ORCPT + 99 others); Sun, 22 Sep 2019 04:30:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:43322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727809AbfIVIaI (ORCPT ); Sun, 22 Sep 2019 04:30:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E6F220820; Sun, 22 Sep 2019 08:30:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569141007; bh=N5M3bZB2ghdYkBfCMLA5K09s+IwMF8I5eMYFoxafSQg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zTWX4XAx8vCjAiXSdG18ckB+C4mvrcPwaHvCA2loxtCRcD9fJxcNejYXsB6A7TCuG 8dyqoM5d8wXqOY9pzn4GUUTpKMU8CcqXULvHqMupEF7dh34/aGpuBV0ZoBAffYA4A6 aj7OH/7s+uCUm6YKX53nqi2uA3H2TqL5Ww1AJmYI= Date: Sun, 22 Sep 2019 10:30:04 +0200 From: Greg Kroah-Hartman To: Pavel Machek Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Artemy Kovalyov , Yossi Itigin , Leon Romanovsky , Steve Wise , Jason Gunthorpe , =?iso-8859-1?Q?H=E5kon?= Bugge Subject: Re: [PATCH 4.19 03/79] RDMA/restrack: Release task struct which was hold by CM_ID object Message-ID: <20190922083004.GA2654133@kroah.com> References: <20190919214807.612593061@linuxfoundation.org> <20190919214808.101726182@linuxfoundation.org> <20190921202209.GA14868@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190921202209.GA14868@amd> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 21, 2019 at 10:22:10PM +0200, Pavel Machek wrote: > Hi! > > > commit ed7a01fd3fd77f40b4ef2562b966a5decd8928d2 upstream. > > > > Tracking CM_ID resource is performed in two stages: creation of cm_id > > and connecting it to the cma_dev. It is needed because rdma-cm protocol > > exports two separate user-visible calls rdma_create_id and > > rdma_accept. > ... > > Mainline says this needs additional fix, fe9bc1644918aa1d, see below. > > > --- a/drivers/infiniband/core/restrack.c > > +++ b/drivers/infiniband/core/restrack.c > > @@ -209,7 +209,7 @@ void rdma_restrack_del(struct rdma_restr > > struct ib_device *dev; > > > > if (!res->valid) > > - return; > > + goto out; > > > > dev = res_to_dev(res); > > if (!dev) > # return; > > This test does return, does it need to go through 'goto out', too? (I > see it should not happen, but...) > > > @@ -222,8 +222,10 @@ void rdma_restrack_del(struct rdma_restr > > down_write(&dev->res.rwsem); > > hash_del(&res->node); > > res->valid = false; > > + up_write(&dev->res.rwsem); > > + > > +out: > > if (res->task) > > put_task_struct(res->task); > > - up_write(&dev->res.rwsem); > > } > > Mainline says res->task = NULL is needed there, see fe9bc1644918aa1d. Good catch, now queued up, thanks! greg k-h