image_fd = fd_reopen_condition(image_fd, O_CLOEXEC|O_NOCTTY|O_NONBLOCK|(FLAGS_SET(flags, DISSECT_IMAGE_MOUNT_READ_ONLY) ? O_RDONLY : O_RDWR), O_PATH, &reopened_fd);
if (image_fd < 0)
- return log_error_errno(image_fd, "Failed to reopen fd: %m");
+ return log_debug_errno(image_fd, "Failed to reopen fd: %m");
r = sd_varlink_push_dup_fd(vl, image_fd);
if (r < 0)
- return log_error_errno(r, "Failed to push image fd into varlink connection: %m");
+ return log_debug_errno(r, "Failed to push image fd into varlink connection: %m");
if (userns_fd >= 0) {
r = sd_varlink_push_dup_fd(vl, userns_fd);
if (r < 0)
- return log_error_errno(r, "Failed to push image fd into varlink connection: %m");
+ return log_debug_errno(r, "Failed to push image fd into varlink connection: %m");
}
if (image_policy) {
r = image_policy_to_string(image_policy, /* simplify= */ false, &ps);
if (r < 0)
- return log_error_errno(r, "Failed to format image policy to string: %m");
+ return log_debug_errno(r, "Failed to format image policy to string: %m");
}
if (verity && verity->data_path) {
verity_data_fd = open(verity->data_path, O_RDONLY|O_CLOEXEC);
if (verity_data_fd < 0)
- return log_error_errno(errno, "Failed to open verity data file '%s': %m", verity->data_path);
+ return log_debug_errno(errno, "Failed to open verity data file '%s': %m", verity->data_path);
r = sd_varlink_push_dup_fd(vl, verity_data_fd);
if (r < 0)
- return log_error_errno(r, "Failed to push verity data fd into varlink connection: %m");
+ return log_debug_errno(r, "Failed to push verity data fd into varlink connection: %m");
}
_cleanup_(sd_json_variant_unrefp) sd_json_variant *mount_options = NULL;
/* ret_values= */ NULL,
&filtered);
if (r < 0)
- return log_error_errno(r, "Failed to filter mount options: %m");
+ return log_debug_errno(r, "Failed to filter mount options: %m");
if (isempty(filtered))
continue;
&mount_options,
SD_JSON_BUILD_PAIR_STRING(partition_designator_to_string(i), filtered ?: o));
if (r < 0)
- return log_error_errno(r, "Failed to build mount options array: %m");
+ return log_debug_errno(r, "Failed to build mount options array: %m");
}
sd_json_variant *reply = NULL;
r = sd_json_dispatch(reply, dispatch_table, SD_JSON_ALLOW_EXTENSIONS, &p);
if (r < 0)
- return log_error_errno(r, "Failed to parse MountImage() reply: %m");
+ return log_debug_errno(r, "Failed to parse MountImage() reply: %m");
log_debug("Effective image policy: %s", p.image_policy);
r = sd_json_dispatch(i, partition_dispatch_table, SD_JSON_ALLOW_EXTENSIONS, &pp);
if (r < 0)
- return log_error_errno(r, "Failed to parse partition data: %m");
+ return log_debug_errno(r, "Failed to parse partition data: %m");
if (pp.fsmount_fd_idx != UINT_MAX) {
fsmount_fd = sd_varlink_take_fd(vl, pp.fsmount_fd_idx);
if (!di) {
r = dissected_image_new(/* path= */ NULL, &di);
if (r < 0)
- return log_error_errno(r, "Failed to allocated new dissected image structure: %m");
+ return log_debug_errno(r, "Failed to allocated new dissected image structure: %m");
}
if (di->partitions[pp.designator].found)
- return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Duplicate partition data for '%s'.", partition_designator_to_string(pp.designator));
+ return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "Duplicate partition data for '%s'.", partition_designator_to_string(pp.designator));
di->partitions[pp.designator] = (DissectedPartition) {
.found = true,
_cleanup_close_ int image_fd = open(path, O_RDONLY|O_CLOEXEC);
if (image_fd < 0)
- return log_error_errno(errno, "Failed to open '%s': %m", path);
+ return log_debug_errno(errno, "Failed to open '%s': %m", path);
_cleanup_(dissected_image_unrefp) DissectedImage *di = NULL;
r = mountfsd_mount_image_fd(image_fd, userns_fd, options, image_policy, verity, flags, &di);
r = sd_varlink_push_dup_fd(vl, directory_fd);
if (r < 0)
- return log_error_errno(r, "Failed to push directory fd into varlink connection: %m");
+ return log_debug_errno(r, "Failed to push directory fd into varlink connection: %m");
if (userns_fd >= 0) {
r = sd_varlink_push_dup_fd(vl, userns_fd);
if (r < 0)
- return log_error_errno(r, "Failed to push user namespace fd into varlink connection: %m");
+ return log_debug_errno(r, "Failed to push user namespace fd into varlink connection: %m");
}
sd_json_variant *reply = NULL;
unsigned fsmount_fd_idx = UINT_MAX;
r = sd_json_dispatch(reply, dispatch_table, SD_JSON_ALLOW_EXTENSIONS, &fsmount_fd_idx);
if (r < 0)
- return log_error_errno(r, "Failed to parse MountImage() reply: %m");
+ return log_debug_errno(r, "Failed to parse MountImage() reply: %m");
_cleanup_close_ int fsmount_fd = sd_varlink_take_fd(vl, fsmount_fd_idx);
if (fsmount_fd < 0)
- return log_error_errno(fsmount_fd, "Failed to take mount fd from Varlink connection: %m");
+ return log_debug_errno(fsmount_fd, "Failed to take mount fd from Varlink connection: %m");
*ret_mount_fd = TAKE_FD(fsmount_fd);
return 0;
_cleanup_close_ int directory_fd = open(path, O_DIRECTORY|O_RDONLY|O_CLOEXEC|O_PATH);
if (directory_fd < 0)
- return log_error_errno(errno, "Failed to open '%s': %m", path);
+ return log_debug_errno(errno, "Failed to open '%s': %m", path);
return mountfsd_mount_directory_fd(directory_fd, userns_fd, flags, ret_mount_fd);
}
r = sd_varlink_push_dup_fd(vl, parent_fd);
if (r < 0)
- return log_error_errno(r, "Failed to push parent fd into varlink connection: %m");
+ return log_debug_errno(r, "Failed to push parent fd into varlink connection: %m");
sd_json_variant *reply = NULL;
const char *error_id = NULL;
unsigned directory_fd_idx = UINT_MAX;
r = sd_json_dispatch(reply, dispatch_table, SD_JSON_ALLOW_EXTENSIONS, &directory_fd_idx);
if (r < 0)
- return log_error_errno(r, "Failed to parse MountImage() reply: %m");
+ return log_debug_errno(r, "Failed to parse MountImage() reply: %m");
_cleanup_close_ int directory_fd = sd_varlink_take_fd(vl, directory_fd_idx);
if (directory_fd < 0)
- return log_error_errno(directory_fd, "Failed to take directory fd from Varlink connection: %m");
+ return log_debug_errno(directory_fd, "Failed to take directory fd from Varlink connection: %m");
if (ret_directory_fd)
*ret_directory_fd = TAKE_FD(directory_fd);
_cleanup_free_ char *parent = NULL;
r = path_extract_directory(path, &parent);
if (r < 0)
- return log_error_errno(r, "Failed to extract parent directory from '%s': %m", path);
+ return log_debug_errno(r, "Failed to extract parent directory from '%s': %m", path);
_cleanup_free_ char *dirname = NULL;
r = path_extract_filename(path, &dirname);
if (r < 0)
- return log_error_errno(r, "Failed to extract directory name from '%s': %m", path);
+ return log_debug_errno(r, "Failed to extract directory name from '%s': %m", path);
_cleanup_close_ int fd = open(parent, O_DIRECTORY|O_CLOEXEC);
if (fd < 0)
- return log_error_errno(r, "Failed to open '%s': %m", parent);
+ return log_debug_errno(r, "Failed to open '%s': %m", parent);
return mountfsd_make_directory_fd(fd, dirname, mode, flags, ret_directory_fd);
}
userns_fd_idx = sd_varlink_push_dup_fd(vl, userns_fd);
if (userns_fd_idx < 0)
- return log_error_errno(userns_fd_idx, "Failed to push userns fd into varlink connection: %m");
+ return log_debug_errno(userns_fd_idx, "Failed to push userns fd into varlink connection: %m");
mount_fd_idx = sd_varlink_push_dup_fd(vl, mount_fd);
if (mount_fd_idx < 0)
- return log_error_errno(mount_fd_idx, "Failed to push mount fd into varlink connection: %m");
+ return log_debug_errno(mount_fd_idx, "Failed to push mount fd into varlink connection: %m");
sd_json_variant *reply = NULL;
r = sd_varlink_callbo(
SD_JSON_BUILD_PAIR_UNSIGNED("userNamespaceFileDescriptor", userns_fd_idx),
SD_JSON_BUILD_PAIR_UNSIGNED("mountFileDescriptor", mount_fd_idx));
if (r < 0)
- return log_error_errno(r, "Failed to call AddMountToUserNamespace() varlink call: %m");
+ return log_debug_errno(r, "Failed to call AddMountToUserNamespace() varlink call: %m");
if (streq_ptr(error_id, "io.systemd.NamespaceResource.UserNamespaceNotRegistered")) {
- log_notice("User namespace has not been allocated via namespace resource registry, not adding mount to registration.");
+ log_debug("User namespace has not been allocated via namespace resource registry, not adding mount to registration.");
return 0;
}
if (error_id)
- return log_error_errno(sd_varlink_error_to_errno(error_id, reply), "Failed to mount image: %s", error_id);
+ return log_debug_errno(sd_varlink_error_to_errno(error_id, reply), "Failed to mount image: %s", error_id);
return 1;
}
if (r < 0)
return log_debug_errno(r, "Failed to call AddControlGroupToUserNamespace() varlink call: %m");
if (streq_ptr(error_id, "io.systemd.NamespaceResource.UserNamespaceNotRegistered")) {
- log_notice("User namespace has not been allocated via namespace resource registry, not adding cgroup to registration.");
+ log_debug("User namespace has not been allocated via namespace resource registry, not adding cgroup to registration.");
return 0;
}
if (error_id)
if (r < 0)
return log_debug_errno(r, "Failed to call AddNetworkToUserNamespace() varlink call: %m");
if (streq_ptr(error_id, "io.systemd.NamespaceResource.UserNamespaceNotRegistered")) {
- log_notice("User namespace has not been allocated via namespace resource registry, not adding network to registration.");
+ log_debug("User namespace has not been allocated via namespace resource registry, not adding network to registration.");
return 0;
}
if (error_id)