# parted code (3.3-1) from focal
--------- libparted/arch/linux.c: ..... => if (fsync (fd) < 0 || close (fd) < 0) if (ped_exception_throw ( PED_EXCEPTION_WARNING, PED_EXCEPTION_RETRY + PED_EXCEPTION_IGNORE, => _("Error fsyncing/closing %s: %s"), name, strerror (errno)) == PED_EXCEPTION_RETRY) goto retry; } } free (name);
# FSYNC(2) RETURN VALUE On success, these system calls return zero. On error, -1 is returned, and errno is set appropriately. ---------
so definitely fsync() fails returning "-1" on the next unused loop device as oppose to any other unused loop device.
The question is why unused loop device fails on fsync() ONLY when it is the next unused loop device after a system boot (losetup -f) ?
# parted code (3.3-1) from focal
--------- arch/linux. c:
if (ped_exception_ throw (
PED_ EXCEPTION_ WARNING,
PED_ EXCEPTION_ RETRY +
PED_EXCEPTION_ IGNORE,
name, strerror (errno))
== PED_EXCEPTION_ RETRY)
goto retry;
}
free (name);
libparted/
.....
=> if (fsync (fd) < 0 || close (fd) < 0)
=> _("Error fsyncing/closing %s: %s"),
}
# FSYNC(2)
RETURN VALUE
On success, these system calls return zero. On error, -1 is returned, and errno is set appropriately.
---------
so definitely fsync() fails returning "-1" on the next unused loop device as oppose to any other unused loop device.
The question is why unused loop device fails on fsync() ONLY when it is the next unused loop device after a system boot (losetup -f) ?