From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 401F23264F2 for ; Tue, 11 Aug 2026 14:18:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786457909; cv=none; b=HTHLe2zb1aL8zNN4pz7cDv7en1c0074TxyNmKy7plTc5KAqGGjNLVSLL0wRXmuWUKMu5RvT6lCOZSYHwUzlag48zjsbhHiIaMF1o+xYHjjfBUxGmbCvmN7G9PRFfKDSGP6MYX2fqv7WKeozqaARu8v4uW1YePQMSoMMqr5sR8H0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786457909; c=relaxed/simple; bh=TVFkoydAlznXR5A7IXPCTxUN7qahHWix2wvBiuB3NUg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rWB+7m+BxdBtljuDUv1CZAonFbsNDXxQX+6mQwCeG1PQjtkP/Krz0y3r+xhELlFxf4IbONtPndZRqh1oy6gavOOwXpnZYPYXZVj0F5dHrnlgdSpJArwARzZMS/u6alr+GAIaxJ6oLyMKHgtQv0wwb1jMBDkuwgauD9YjrexMGek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=jpNcLLNn; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="jpNcLLNn" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-8f23e851626so5848566d6.3 for ; Tue, 11 Aug 2026 07:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1786457907; x=1787062707; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=tCDsBFzkZJqhcWUDi/0LzMxGU8EldkuTj969HWAWJKc=; b=jpNcLLNnbDe0ehALjTx2e+bX13C7fJOSdWkrHwLY9IM7xxA4hXx0RchS8VUMUBpe/Q shLQHa7mSUVMRDOPm0ybOFeoH4rP0uuD74CGPC/Dgazp4TITiIJ/5v4P4o/HsnviN+H8 Z9XAdrk49NF387TDyFLyQEIGeA3uJG+DG/HbHjmFPpPEX+CnhINTTB/ysx8uhAKclsb7 JHz8+axYN1VNiH9WQ2VUtDRKF7vW1U0H9cyZr5WrTevwq3ipggoKB85WEMF4aCZoTnKh OH71tIJARCtUgNMBJNsgOpm776jCJy4OOT5kJWUO3Kk8t20ab6w4/5guMePDqoxxCQzu ik+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786457907; x=1787062707; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tCDsBFzkZJqhcWUDi/0LzMxGU8EldkuTj969HWAWJKc=; b=QkThJsrTbuzhV6/TWrWZ6KtY9o6R6dEu29nogTCJDnSAM31ZIZs6R7cZbjx7CaiDhO ZsV3PD8KxMws1Da1y19VDb/gBPp/xeCAmry047WuMwo7wQ/Ywam8BC4GLe9L1CKqZ0Ol udy2cG1u4DMrxMKIc4Btni79NrRe+4RpESJ1xiZWtSGo/MSdYomGtz4/js88eEy47pp8 YTWY0+0j7dTW4mVozxyLZFSrZ5KUntR5V0ps0ZCFzd6k7jCXzq3msagGkWPzc9n4g4l7 esGh5MtAar518ON/Qb/nq90xO4o3s0QYME6HgMDEqwHli7qG3We9ivsHg18HdOSngy1r kgQg== X-Forwarded-Encrypted: i=1; AHgh+RrjJd37tJY2imRNECHubc2aSKow5SdKUGfB2SiDh8802SSU3DfpVY3HrTpFBxJp0hZQf6mWtrjFgePL/WI=@vger.kernel.org X-Gm-Message-State: AOJu0YzAiR6/OhCxWBPIOAGHPSSFnJ0/u1/A1sJRHZleM1bgmQaEDW9O QYRQHdO+BknjxbnF40Y5r5HWEPuWsZ3edMz4Bmjv9Ea1DTEWjG/i2yxEwiVIicqav7M= X-Gm-Gg: AR+sD10toE02K1I3weIburXk9lBTK3a61ObVeG5JyFltR//9vxNGHTV3O8ek442EjY0 sRwYeHkW7Sy5MWWdDB+ug48Se+IUD0VWY1SrwjpPOt0Fe0VEAG5Ty5rzFKBAjijWHgVVGscOzvx 06ns/WTRn3bTPa4Py2dBOIdYejyhxwoycriLiTsQzyGqnI79d5KX++O7mDzqb7nn62IO3O2gOlU XeOn7PZaTCDr6N964VQa6gdJlFi6mtLhZi1PxUFspqMCo8EEjmvs03z+thQYW6rD8RggcwrfF2T BnwxJgIrW3BM2QUs9IFb3K88c2UtTH7ckimDS0zhomZoLPUqIDXLvHhvPQDtu+PccCWog2vnnLW 8ZAuXBbrX9leJpyN4UvMGKpYKpciJoA7dFCae8Ir36OB2NavshGUCmyb0X8hN3zHUbPYWKvuIet XD7YMhfXrCzjIEtcVdNJti/pgiHLDN0zPlY0MZnP4= X-Received: by 2002:a05:6214:2302:b0:8f1:323a:fc45 with SMTP id 6a1803df08f44-90a6c1a0f4bmr2335066d6.15.1786457907128; Tue, 11 Aug 2026 07:18:27 -0700 (PDT) Received: from ziepe.ca ([142.166.156.215]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90a6c3c17a2sm102366d6.33.2026.08.11.07.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 07:18:26 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wtnJB-00000002VEo-3AUh; Tue, 11 Aug 2026 11:18:25 -0300 Date: Tue, 11 Aug 2026 11:18:25 -0300 From: Jason Gunthorpe To: Yili Zhang Cc: leon@kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] RDMA/core: Untrack resources before driver destroy Message-ID: <20260811141825.GE544626@ziepe.ca> References: <6a7affe3.26268144.122abf.417fSMTPIN_ADDED_BROKEN@mx.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a7affe3.26268144.122abf.417fSMTPIN_ADDED_BROKEN@mx.google.com> On Tue, Aug 11, 2026 at 06:56:22PM +0800, Yili Zhang wrote: > From: Yili Zhang > > When a userspace RDMA object cannot be destroyed by the driver during > ib_uverbs_close() (e.g. mlx5 destroy_cq/destroy_qp fails because the > hardware is in a transient error state), That's a bug in of itself, if the HW is erroring then the destroy should wait for the error to progress past flr and then let the destroy continue. > Fix it by moving rdma_restrack_del() to *before* the driver's destroy > callback, so the restrack entry is removed at the moment we commit to > destroying the object rather than only on success. No, that messes up legitimate cases where the destroy is allowed to fail. AFAICT the issue here is the netlink is not allowed to access the context without proper locking. Jason