Merge pull request #24495 from poettering/loopback-block-msg

improve loopback warning message
This commit is contained in:
Yu Watanabe 2022-08-30 01:10:43 +09:00 committed by GitHub
commit 3c82f2028d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -284,7 +284,7 @@ static int loop_configure(
if (ioctl(fd, LOOP_SET_STATUS64, &info_copy) >= 0)
break;
if (errno != EAGAIN || ++n_attempts >= 64) {
r = log_debug_errno(errno, "Failed to configure loopback device: %m");
r = log_debug_errno(errno, "Failed to configure loopback block device: %m");
goto fail;
}

View file

@ -208,10 +208,10 @@ int loopback_setup(void) {
/* If we lack the permissions to configure the loopback device,
* but we find it to be already configured, let's exit cleanly,
* in order to supported unprivileged containers. */
if (state_up.rcode == -EPERM && check_loopback(rtnl))
if (ERRNO_IS_PRIVILEGE(state_up.rcode) && check_loopback(rtnl))
return 0;
return log_warning_errno(state_up.rcode, "Failed to configure loopback device: %m");
return log_warning_errno(state_up.rcode, "Failed to configure loopback network device: %m");
}
return 0;