Re: [PATCH] block: mtip32xx: synchronize ioctls with device removal
Jens Axboe <[email protected]>
| Newsgroups | org.kernel.vger.linux-block |
|---|---|
| Message-ID | <178683855833.1984298.10971341503656309958.b4-ty@b4> |
On Thu, 06 Aug 2026 14:04:41 +0800, Hongyan Xu wrote:
> The ioctl handlers only test REMOVE_PENDING before entering
> mtip_hw_ioctl(). Removal can set that bit immediately afterwards and free
> dd->port in mtip_hw_exit() while an ioctl still dereferences it. An already
> open block device can reach the handlers while del_gendisk() is in
> progress.
>
> Serialize both native and compat ioctls with removal. Set REMOVE_PENDING
> before taking the mutex so new callers fail after an in-flight ioctl has
> drained, and hold the mutex until the port has been torn down.
>
> [...]
Applied, thanks!
[1/1] block: mtip32xx: synchronize ioctls with device removal
commit: 68940f841d013192086a0f6d7cfbac2cd079e228
Best regards,
--
Jens Axboe