From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.217.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145393; b=pBqrdXvNuZwSwSWp1Lr21JPeBEx3ozte0NF+A9KMoWva2GWesVFd4ZjtcxVA5kDrEijX S4zHMtDo6VWzdNILCut3cT4EMM4rwtev416KdYe0Vb/+Gq1HFpd80Tm5mpaEmjKwpnr1T b/iL+KXwa8By7sw1Lbk9DOS2sgWopC6FSR8lDou/XcfNi1pgrM2ojtBvZr4ovVvbKMWKB VrsYOcJQc/9oTWfuxYXfsyis7hesAh5zlhahUC6E/JZraXIXHbjbesfw+OdbA1oYgdRjj cO1ZJyfuYAS3vbjPYpL9sJQB20gPUKPuNXqABmRDL10d2HrgrV3EEjfExiiAiGFyyyw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796145393; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=9qDnFKBLllB4vVs0b90a9cp7wk9WHMB+4+uHz7Om1mM=; b=EA2S1GQcnDrB4BozTpHd38PXz9JDYGXgRLDAZ3EdPdJBctt3o8SuKL1jP71GaeCrjKC+ P0LbXlX5WJwsuEsxuwaCBuNiz4+NaypSVPx+6GLefwYWOLcDLoCzYFVG33PCsa24R82+E Fz6DFqJiHKP1W86qIYdCHP/BgP4N4JlBSbVPb08e8Qpb9//jdl5OBIzR5VNjRXezk5ZJi uT677EC4zdfcdnkhZmLX40AyJzPgstiVO3GFQs3x+sKUI/7sQEe67bI2+U0gY0eo0wnqU B1p+nuXzKW7M0AmagHcP7vGilBk7n8c3dQh6XYVKkSPLtbQhWywSSltVIs91Q5WkFGQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b="JXQvLuT/"; arc=none smtp.remote-ip=209.85.217.45 Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D10CC606A31A for ; Tue, 1 Dec 2026 17:16:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D10CC606A31A 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.a=rsa-sha256 header.s=google header.b=JXQvLuT/ Received: by mail-vs1-f45.google.com with SMTP id ada2fe7eead31-7cc1cf48a39so4692137137.1 for ; Tue, 01 Dec 2026 09:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1796145392; x=1796750192; 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=9qDnFKBLllB4vVs0b90a9cp7wk9WHMB+4+uHz7Om1mM=; b=JXQvLuT/5EFqWxbIsn3/pSZzXgfq2jp8Ueo8gd4yx00OyJswW+oLI1Gq+UmiIY1YZo g0k5HifO7Im72DobA3TbuQ6DYFylaQUvqZdM4Us/GFUXNbo/h0IlsAbBHJqVs70N2NUD ry3zM2QTPwIcMdksVi/jH7gyMMKCjawuf9MWoYqIQZniuk6h2DNTOEGQMyf+HKCOgM6k T6m2etegTHxXFP7Zi6I8PvfEh+Lg4X5Lmm71YfFd3II3HXfxbX5YizG5vllny3AtTmMY Cie+7UNUh4BM9D5afOVJ5Ywyyo6uWrXOunWF5IZMPufLVKQCQiqZZWSdAvHHiGRHfoIl Hyrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796145392; x=1796750192; 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=9qDnFKBLllB4vVs0b90a9cp7wk9WHMB+4+uHz7Om1mM=; b=L9bxl2BGdyV4fCaa8xXGFKBZocxAcmjAhYz0pZLWojUcGqCMw3H/XCql8midCbHvxG C/Wz1I0raWvQA0xecVGeQaQ85DZT9R0kjYVNKlutBalE3U8wC+PKQqASHKr3xDhxXxIg qZF5DxekDT5YXpNOSODdUkVzg/RNdmAOZuvp8KwM4Q+0MPfHTPAm7Catu2WBzXq0pHul TM4wUBsR9r2JCgoO998FUAIi4UqJIR/r4eQf1qYL79s/iUROMeKvFH0R/DnbXuiCGYQF R8PEIuOm51wVzbsHQ9uHHp5TI37wkiqkMKOH3LktnpCmMuoRWDx6wu9DMNQ0rZP7vA/m N5xA== X-Forwarded-Encrypted: i=1; AL+hErFmJ3y9WTZ1Cwu+8abmSru0Tl2Xbzp0nIfLHkquX4wSL/sb9TX32mORzzt6zuFD68vBOW8Z4Ebmewk3@vger.kernel.org X-Gm-Message-State: APuU4Z+YrT5e+62xQMz9lnsfetBaB0DlJ/3B+1uKX3n+Cq+QGO2NC4R+ IkNARo6ztBU4sIC6cuPfQBfNWWueghngv2/elMOpjyjc9pWW+HeVq5lmFhJQ4uBqs2ESVqJ6FyU QV9C/ X-Gm-Gg: AZFdTZe0U5ZWSdfi9cEDDbHkuR+I+gssZ/Z0YTDtATDQmnTwoTbzHktFbOG3OIbv4t8 QbAJ6/Qekq1jehLvlMtjslAQaRGDuwoXWHwTmSzqBjij1rdPplsS/IFXtNqAem5TJZLIaUcKkQq WKOae5WII/ze3qxylyKH+Yd6GOKYtSebfylY9G+TeBpeqauvsf83XmAJDsRPh26+rKs3zfF0Rin PQ7R9zFG3D6G1sFKpxC7msG9GRfyCT/zrc8JpyK7+b+CqPJHYP/C1udJsLd3XTCxuynv3y72wdd kV05D3pRyzUTPw8WFT8CByR/tt93mkkPtXDythr7t3oUpdHNHjqQddZWg1G/2/n/uUQQM1kkfLb p0/wcGsZ3CiWObgn8dwaW4uGoATPLpKfpftunsB2Ysj8q6PPaMKJachMq0OCA+P5FTvgAwz/jqa KaXRFapM+IONElZ5sD/tByw70dN/0tXZ0QBpC5m7CnQ2E8iigQrzPCEiZ8cdFiZmzUvc9/rNQuT w+VavDAnNm3wMnr1ZuGoEbZQerO0MGpeRWT0CconvwP5/Y+0jAm6yn0MWp8y8iBYWEyNhbTuwxe LcjD X-Received: by 2002:a05:6102:160b:b0:7cc:9d82:61e2 with SMTP id ada2fe7eead31-7d739696e23mr23665358137.13.1796145391747; Tue, 01 Dec 2026 09:16:31 -0800 (PST) Received: from ziepe.ca ([142.177.118.84]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349f2186sm333180266d6.29.2026.12.01.09.16.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 09:16:31 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xYRSw-00000001GOG-2lJr; Tue, 01 Dec 2026 13:16:30 -0400 Date: Tue, 1 Dec 2026 13:16:30 -0400 From: Jason Gunthorpe To: Leon Romanovsky Cc: Jaeyeong Lee , Artemy Kovalyov , Yishai Hadas , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v3] RDMA/mlx5: Preserve DEVX objects after failed output copy Message-ID: <20261201171630.GK1856591@ziepe.ca> References: <20261111105346.3220427-1-lee@jaeyeong.cc> <20261115135123.GD42525@unreal> <20261122103715.51731-1-lee@jaeyeong.cc> <179574905000.68536.2524255610860968331@jaeyeong.cc> <20261201153000.GG31440@unreal> X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201153000.GG31440@unreal> On Tue, Dec 01, 2026 at 05:30:00PM +0200, Leon Romanovsky wrote: > On Fri, Nov 27, 2026 at 03:10:55AM +0000, Jaeyeong Lee wrote: > > A DEVX create command can succeed before indirect mkey registration or > > copying the command output to userspace fails. The current unwind path > > destroys the hardware object directly, ignores a destroy failure, and > > frees struct devx_obj. > > > > If the object cannot be destroyed, > > How can this happen? This is exactly why your reproducer is invalid, it > does not account for how real hardware behaves. It definately can happen, I gave an example intending him to paste it over.. You can create a PD with devx, stall the kernel thread through various well known means and then make the copy fail. During the stall you guess the PDN and create a MR within it. Now FW will not destroy the object due to its refcounting. There are probably many examples beyond this. The patch looks OK to me and the code now matches how this was expected to be used, with finalize preceeding a manual copy to user. Jason