<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/libbb/loop.c, branch cron_changes</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=cron_changes</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=cron_changes'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2026-01-26T04:43:17+00:00</updated>
<entry>
<title>libbb/loop: fix existence check for LOOP_CONFIGURE ioctl</title>
<updated>2026-01-26T04:43:17+00:00</updated>
<author>
<name>Wouter Franken</name>
<email>wouter.franken_ext@softathome.com</email>
</author>
<published>2026-01-20T09:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4e82d99460d36ab09b651eb90c77e7cd13fb368a'/>
<id>urn:sha1:4e82d99460d36ab09b651eb90c77e7cd13fb368a</id>
<content type='text'>
The LOOP_CONFIGURE ioctl is supported in 5.8 kernels and up. To have
backwards compatibility there is a config option CONFIG_TRY_LOOP_CONFIGURE
that will check if the ioctl exists and if not fall back to old way of
configuring loop devices.

Normally errno will be set to EINVAL when this ioctl does not exist.
However, when kernel config CONFIG_COMPAT is enabled, then compat_ioctl
is called. In that case -ENOIOCTLCMD is returned by loop device driver
and generic ioctl wrapper will set errno to ENOTTY. Because busybox
does not expect this it will fail to mount loop devices in this case.

This patch fixes the check for the existence of the ioctl LOOP_CONFIGURE
by checking if errno is one of both: EINVAL or ENOTTY.

function                                             old     new   delta
set_loop                                             809     821     +12

Signed-off-by: Wouter Franken &lt;wouter.franken_ext@softathome.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb/loop: fix compile failure (name collision)</title>
<updated>2023-01-02T16:03:44+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2023-01-02T16:03:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e7977df2cae2ac2c5da38f77488ec9e97d10c33b'/>
<id>urn:sha1:e7977df2cae2ac2c5da38f77488ec9e97d10c33b</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb: shrink del_loop()</title>
<updated>2022-12-13T15:00:00+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2022-12-13T15:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=7710250e4a610ae6a4d8f6feb5500f16f82d19f4'/>
<id>urn:sha1:7710250e4a610ae6a4d8f6feb5500f16f82d19f4</id>
<content type='text'>
function                                             old     new   delta
del_loop                                              52      49      -3

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>loop: restore the correct return vaule of set_loop()</title>
<updated>2022-12-13T14:52:52+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2022-12-13T14:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=a55bd1c4847dda99cf9e65519ed67f3bcc9786d8'/>
<id>urn:sha1:a55bd1c4847dda99cf9e65519ed67f3bcc9786d8</id>
<content type='text'>
It is only used by mount's error path, though...

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>loop: optionally use ioctl(LOOP_CONFIGURE) to set up loopdevs</title>
<updated>2022-12-13T14:21:28+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2022-12-13T13:27:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=45734a23515b3e1f2305ad33dc22d1bc69e3cba6'/>
<id>urn:sha1:45734a23515b3e1f2305ad33dc22d1bc69e3cba6</id>
<content type='text'>
LOOP_CONFIGURE is added to Linux 5.8

function                                             old     new   delta
NO_LOOP_CONFIGURE (old code):
set_loop                                             784     782      -2
LOOP_CONFIGURE:
set_loop                                             784     653    -131
TRY_LOOP_CONFIGURE:
set_loop                                             784     811     +27

Based on a patch by Xiaoming Ni &lt;nixiaoming@huawei.com&gt;

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>loop: refactor: extract subfunction set_loopdev_params()</title>
<updated>2022-12-13T13:26:20+00:00</updated>
<author>
<name>Xiaoming Ni</name>
<email>nixiaoming@huawei.com</email>
</author>
<published>2022-12-13T12:13:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=a1856934ba795f81546f5dd9a14ba4faa757ce52'/>
<id>urn:sha1:a1856934ba795f81546f5dd9a14ba4faa757ce52</id>
<content type='text'>
Extract subfunction set_loop_info() from set_loop()

function                                             old     new   delta
set_loop                                             760     784     +24

Signed-off-by: Xiaoming Ni &lt;nixiaoming@huawei.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>loop: simplify code of LOOP_SET_FD failure</title>
<updated>2022-12-12T18:03:06+00:00</updated>
<author>
<name>Xiaoming Ni</name>
<email>nixiaoming@huawei.com</email>
</author>
<published>2022-12-12T17:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=7dc76c9f210b3c66a9c89e6690af7b49f6c540a8'/>
<id>urn:sha1:7dc76c9f210b3c66a9c89e6690af7b49f6c540a8</id>
<content type='text'>
function                                             old     new   delta
set_loop                                             790     760     -30

Signed-off-by: Xiaoming Ni &lt;nixiaoming@huawei.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>loop: refactor: extract subfunction get_next_free_loop()</title>
<updated>2022-12-12T17:57:09+00:00</updated>
<author>
<name>Xiaoming Ni</name>
<email>nixiaoming@huawei.com</email>
</author>
<published>2022-12-12T17:41:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ddccf6cd2f519c46a6286a43ceaf680eb367301c'/>
<id>urn:sha1:ddccf6cd2f519c46a6286a43ceaf680eb367301c</id>
<content type='text'>
Extract subfunction get_next_free_loop() from set_loop()

Also fix miss free(try) when stat(try) and mknod fail

function                                             old     new   delta
set_loop                                             807     790     -17

Fixes: 3448914e8cc5 ("mount,losetup: use /dev/loop-control is it exists")
Signed-off-by: Xiaoming Ni &lt;nixiaoming@huawei.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>loop: fix a race when a free loop device is snatched</title>
<updated>2022-11-15T13:54:05+00:00</updated>
<author>
<name>Xiaoming Ni</name>
<email>nixiaoming@huawei.com</email>
</author>
<published>2022-11-15T13:54:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=cb8d2ea8c91b5671b05e06ab2282496104453378'/>
<id>urn:sha1:cb8d2ea8c91b5671b05e06ab2282496104453378</id>
<content type='text'>
When /dev/loop-control exists and *device is empty,
the mount may fail if a concurrent mount is running.

function                                             old     new   delta
set_loop                                             809     807      -2

Signed-off-by: Xiaoming Ni &lt;nixiaoming@huawei.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>mount: if we race with other loop mount, we forget to close loop dev</title>
<updated>2020-12-17T22:38:06+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-12-17T22:38:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=15733cb48e570716cad6ece2d752507ecd767131'/>
<id>urn:sha1:15733cb48e570716cad6ece2d752507ecd767131</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
