1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

loop-util: fix error condition and return value

Fixes a bug introduced by da4fd28871.

(cherry picked from commit 2421dd7267)
This commit is contained in:
Yu Watanabe 2023-02-18 15:35:41 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent ec6c1fbf7d
commit 6dafcad55c

View File

@ -577,8 +577,8 @@ static int loop_device_make_internal(
* device, and called LOOP_CTL_REMOVE on it. Let's retry with a new number.
* -EBUSY: a file descriptor is already bound to the loopback block device.
* -EUCLEAN: some left-over partition devices that were cleaned up. */
if (!ERRNO_IS_DEVICE_ABSENT(errno) && !IN_SET(r, -EBUSY, -EUCLEAN))
return -errno;
if (!ERRNO_IS_DEVICE_ABSENT(r) && !IN_SET(r, -EBUSY, -EUCLEAN))
return r;
/* OK, this didn't work, let's try again a bit later, but first release the lock on the
* control device */