From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.217.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145393; b=5P7aqHwoDlvbNZ9YH+hbi54nFEI+x6Z3lAoJDz6tojV4WTX5zLn3GoXwuXqWbc3UF3h2 XJnc7x5qHIk8GRtFE/6d7vNBjdemE2MsSmvxj0OkkfRdffw4Um2q5NtIexAylXi7AVn7w B1893Z2Rc1vV1NAaMcpSxV1mga+ea06oaTOG7rz1nGuyVwYb2NsHseuxYBab01gMtUJUv YXdL+SawHIdZPDWMTA51aqWTskZHjQ+LYt1JrK2TH/9E2Pc4ncMX3hMIDkaCo6j+WHw6w 1LSZKyOHvGRMLe2k8svmY074H4Y8Z9NNM3bgBs4r7dJQv1653DofVLNCH1Ll1BCAUZA== 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=d1h4WyFUtHq+ElEdOv8yew3YJck3Slw4kZKKr6Kz2Co5W44q+gCkaKKNoLCvjSBjkqah OTrlaiSKSrWSn5LR1F/IbEdWq1xMKXulvOVnQPL/ibYR2DEzKeQIGC95gF13QS7Exs7pd wd5b7lkNjaZ6jzOvYK6R0Xdc6eE+suIbtMWWuRgKGrawvdeyDfrZdcgIPtfIbHUxIZIh+ a9AmEhX9kXuk7rvNcZKfQSExBsyJN9JqjlcmbGsHcGpVuJ8eGUhRyqrLaBjfMnNlNg2Z9 CgSi+FBTbZIct7q12NcmAhhUF0A6oMYKEJ32QMEc5F3tC82UYrt6LRlj1EV7a+mSJ6Q== 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.52 Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (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 D2CE4606A320 for ; Tue, 1 Dec 2026 17:16:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2CE4606A320 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-f52.google.com with SMTP id ada2fe7eead31-7d2dbe5c4b0so4645865137.0 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=le6TrClz2/Nq855O7gsHDRxNJCZs6VkKchFqGgQeTlgqrjvtw8ooUi3+dx5rarY96k zn+wWKV7GOqQyII2fPADxSG2HopaxSX+I/IyUv3q3mvU6ptQOTFcZk5XLO9zHvIMOVpz v8wyf6q7KLYtI7VnnQdmXz1OZ5k4IRb5X0rhjZfXci234X4SEpW8QTpjotyAjFlaDGJj lDJ9BBHH0cF/bwwDFcFQEDdTBmsY5gQM/BbHl6mig+tOYrT2XfHDg2AvrljdRE4gRkcD xeWLkELVSWXDparodkuispJs9M8sHuOQwDL8ZwYYeONAwCT7nj1SDfP4RI1D2Nugca6e 0yhA== X-Forwarded-Encrypted: i=1; AL+hErG5eGf+xkmz7KOirNQx4tLLVn7/5SGTDFV6dZj0LWIl6uzVWgS7RK3sJwkLR7dqR/Wqw3fob2jvez+s/6c=@vger.kernel.org X-Gm-Message-State: APuU4Z89/PglHlZo76Nez2KOJ/B1F1Izb41T1mEiclwucq24Inc0rsqQ hQgs3DjAwLwWA+HdnbbfaQxtSGlfvMPdzHUyO1FHIGPuvhBXuYs1DUNUyH3IIp0hWGU= X-Gm-Gg: AZFdTZelN0fz1gsSyIWAdkXVwlqIJk4HbkTLH2JAtQo5UtPvIQ4DklW5urOjn10J/s1 mgLCTesejmyFLW8QD1ncEoPwD77MVx6uIJ+QTCNeYRfMfr0VWcHsNEPIgfw+OlDTwgFTN9PSh2y d3e4EMbNt4z/eXt6mdqo0QiFitkM52ilxc0ns80EoqgYMwfnz3N36OS5Gz8OCernUWN3w8BSbhP /KybLUFVQ355ySmeoWiRKAEqZn311OwnoQjy2ZfzLtuWw2oIMEygWMahR3zkxLPGtU9Tan7sea1 qxEyqcc2NCdOlW+Hjfx4PmMa/wF4x8nwyet8A+0nDVk4EaO78E1Zzku7VB6h8Di5VMKcxAWs4T8 nTU8WIvG/emW8IHUcP8/BwajqAKbWkgpECpj9IIkwz2B6RtV9Gy7HErqPLdvGEFsuP5FeQs8KJx llEtGauPr8Kx9foaqky8LgJ2moVZWqzu2arboueI6+Ihetiom1ZjwlBj76igyAQ6E3EOS4MQfkZ WvLF0mYKk5pxpFKiBib3VA/VLzD/WhenX/gDzElSEtft4MDOFlwzTVXT0nLN84jQr/UewWasK6S R2v8 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-kernel@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