ublk: run auto buf unregisgering in same io_ring_ctx with registering
authorMing Lei <ming.lei@redhat.com>
Thu, 22 May 2025 15:20:40 +0000 (23:20 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 May 2025 16:03:55 +0000 (10:03 -0600)
commit914e0dc5082a335ea5e7d905e99e1a1cde001369
tree9572afb2705e06a4f7387275496753f65ddd3f15
parent3a91f28fab43f093c72312148288d125ae160c2d
ublk: run auto buf unregisgering in same io_ring_ctx with registering

UBLK_F_AUTO_BUF_REG requires that the buffer registered automatically
is unregistered in same `io_ring_ctx`, so check it explicitly.

Document this requirement for UBLK_F_AUTO_BUF_REG.

Drop WARN_ON_ONCE() which is triggered from userspace code path.

Fixes: 99c1e4eb6a3f ("ublk: register buffer to local io_uring with provided buf index via UBLK_F_AUTO_BUF_REG")
Reported-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250522152043.399824-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c
include/uapi/linux/ublk_cmd.h