} else if (r < 0)
return log_error_errno(r, "Failed to read symlink /run/systemd/volatile-root: %m");
else {
- r = acquire_root_devno(device, NULL, open_flags, &context->node, &context->backing_fd);
+ r = acquire_root_devno(device, /* root= */ NULL, open_flags, &context->node, &context->backing_fd);
if (r == -EUCLEAN)
return btrfs_log_dev_root(LOG_ERR, r, device);
if (r < 0)
return r;
if (p.node) {
- context->node = TAKE_PTR(p.node);
+ r = acquire_root_devno(p.node, NULL, O_CLOEXEC|context_open_mode(context), &context->node, &context->backing_fd);
+ if (r < 0)
+ return log_error_errno(r, "Failed to open file or determine backing device of %s: %m", p.node);
r = context_load_partition_table(context);
if (r == -EHWPOISON)