<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/tools/testing/selftests/ublk/ctrl.c, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>selftests: ublk: fix the build and file offsets on 32-bit</title>
<updated>2026-11-04T14:57:44+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>sashal@kernel.org</email>
</author>
<published>2026-11-03T16:39:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3197517875fdcfae1e9b5a4dcaf35cbbd66c413c'/>
<id>3197517875fdcfae1e9b5a4dcaf35cbbd66c413c</id>
<content type='text'>
kublk puts pointers into 64-bit UAPI and SQE fields with a plain (__u64)
cast. ublk builds with -Werror, so it fails to build on 32-bit
architectures:

  batch.c:379:42: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

Cast through uintptr_t. kublk also passes 64-bit user copy offsets,
which start at UBLKSRV_IO_BUF_OFFSET (2 GB), to pread() and pwrite(),
and with glibc those are truncated to a 32-bit off_t there. Build with
-D_FILE_OFFSET_BITS=64 as well.

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Reviewed-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Link: https://patch.msgid.link/20261103163928.641519-1-sashal@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
kublk puts pointers into 64-bit UAPI and SQE fields with a plain (__u64)
cast. ublk builds with -Werror, so it fails to build on 32-bit
architectures:

  batch.c:379:42: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

Cast through uintptr_t. kublk also passes 64-bit user copy offsets,
which start at UBLKSRV_IO_BUF_OFFSET (2 GB), to pread() and pwrite(),
and with glibc those are truncated to a 32-bit off_t there. Build with
-D_FILE_OFFSET_BITS=64 as well.

Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Reviewed-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Link: https://patch.msgid.link/20261103163928.641519-1-sashal@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>selftests: ublk: move the control command helpers into ctrl.c</title>
<updated>2026-10-16T00:25:35+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2026-10-11T06:35:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cdf6e5de86a91da6e4d621260bc70e99e2f3a25e'/>
<id>cdf6e5de86a91da6e4d621260bc70e99e2f3a25e</id>
<content type='text'>
Move the ublk_ctrl_*() helpers and ublk_setup_ring() out of kublk.c,
so a small test program can send control commands without copying
them. kublk still links every *.c file, ctrl.c included.

ublk_ctrl_deinit() now also exits the control ring, and ublk_ctrl_init()
checks the allocation and closes /dev/ublk-control when the ring setup
fails. kublk calls them only around its own lifetime, but a test which
opens a control handle per thread must not leak.

No functional change for kublk.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Tested-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Link: https://patch.msgid.link/20261011063555.1142277-10-tom.leiming@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the ublk_ctrl_*() helpers and ublk_setup_ring() out of kublk.c,
so a small test program can send control commands without copying
them. kublk still links every *.c file, ctrl.c included.

ublk_ctrl_deinit() now also exits the control ring, and ublk_ctrl_init()
checks the allocation and closes /dev/ublk-control when the ring setup
fails. kublk calls them only around its own lifetime, but a test which
opens a control handle per thread must not leak.

No functional change for kublk.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Tested-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Link: https://patch.msgid.link/20261011063555.1142277-10-tom.leiming@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
</feed>
