Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2944294ybj; Mon, 23 Sep 2019 12:00:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxnKmqv67CPLRKW+c0NpEDvejB06ai5W7FUp5gzoVfJW9GCZcqJ0WqtuFZkMW83gvsoVXB X-Received: by 2002:a17:906:6d1:: with SMTP id v17mr1185667ejb.74.1569265221583; Mon, 23 Sep 2019 12:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569265221; cv=none; d=google.com; s=arc-20160816; b=GxNWTeZlp88DNOV/2aORI8VAyNGcP2TQX+BB1spofr39WEFUv6mymtAwNUvHE3762V B5+5r6SY3K5pxV8AnY958F0cIdAnNal0+WB8Yp48emETTBfx1wImiWJelD2+4zo86x9n ktjsCEhV4k4WDeycCBGskGJbq+dlI63y8PxwfNwhm7MwnFNzKfJJ7UfT3lFX9Tmro5Md 1uQaujs+BYFWVcEQEOPal73Yd7Nvg+5az8IEOJ96koc8gzrFzCaWDiXVI+3QtmtMA6Ru 7Z9Og3IO/JBstUoAVLOQ5J845KLUhA4Eh09GlkSMv/0XTTN1pUlUv+W/3l/eOojryKA3 nFQw== 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; bh=SxL4OQrSjoxbl16BekTtsmdC+bf8H0OLnqtObIxPX2Y=; b=G0Ix3sZnm1Qf64dAKHy8My1OW/sQVl+/rw+HO4eYRbSmZKysllBdROWjwhMj7onq+e b5TelqULU1Wq9dLnk7mf+fIQYtcmRJdBogPcxoA6pbfIhVP9TS4SGsryn6bUBpnyRIKz /PGl7F6U/Sc0OniRRWlVyVTSD0KpOscUVlWkyTWWRZo6arGzw2zgJuHM5CDlc4JnjJSX FHsWcqtlNq7R32RwuzE8wypPuVHH0W35CP0W0oWmARgOsjrghXAroIL174ZwYtYz/92F n/IYCccAQmuPhaz0FyhQ6Bmdbx4J6tjZ7JgiWM7hVU39kicl9dZF0omsqg/uHvPsIobo DudQ== ARC-Authentication-Results: i=1; mx.google.com; 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 l45si7386886edc.185.2019.09.23.11.59.58; Mon, 23 Sep 2019 12:00:21 -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; 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 S1726127AbfIUUWO (ORCPT + 99 others); Sat, 21 Sep 2019 16:22:14 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:54553 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfIUUWO (ORCPT ); Sat, 21 Sep 2019 16:22:14 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 47D1480315; Sat, 21 Sep 2019 22:21:56 +0200 (CEST) Date: Sat, 21 Sep 2019 22:22:10 +0200 From: Pavel Machek To: Greg Kroah-Hartman 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: <20190921202209.GA14868@amd> References: <20190919214807.612593061@linuxfoundation.org> <20190919214808.101726182@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <20190919214808.101726182@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > commit ed7a01fd3fd77f40b4ef2562b966a5decd8928d2 upstream. >=20 > 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. =2E.. 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; > =20 > if (!res->valid) > - return; > + goto out; > =20 > dev =3D 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 =3D false; > + up_write(&dev->res.rwsem); > + > +out: > if (res->task) > put_task_struct(res->task); > - up_write(&dev->res.rwsem); > } Mainline says res->task =3D NULL is needed there, see fe9bc1644918aa1d. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl2GhnEACgkQMOfwapXb+vI1JQCgg8/N6Ipu7I1fdlTvtVIoGM/9 wGkAn0omzraV89eMjfMK7WXaKd2GibGn =ayIv -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6--