Browse Source

Do not happily NBD "map" non-existing images, do not try to benchmark them too

non-odp-rdma
Vitaliy Filippov 11 months ago
parent
commit
0757ba630a
  1. 6
      src/fio_cluster.cpp
  2. 6
      src/nbd_proxy.cpp

6
src/fio_cluster.cpp

@ -247,6 +247,12 @@ static int sec_setup(struct thread_data *td)
vitastor_c_uring_wait_events(bsd->cli);
}
td->files[0]->real_file_size = vitastor_c_inode_get_size(bsd->watch);
if (!vitastor_c_inode_get_num(bsd->watch) ||
!td->files[0]->real_file_size)
{
td_verror(td, EINVAL, "image does not exist");
return 1;
}
}
bsd->trace = o->trace ? true : false;

6
src/nbd_proxy.cpp

@ -190,6 +190,12 @@ public:
}
watch = cli->st_cli.watch_inode(image_name);
device_size = watch->cfg.size;
if (!watch->cfg.num || !device_size)
{
// Image does not exist
fprintf(stderr, "Image %s does not exist\n", image_name.c_str());
exit(1);
}
}
// Initialize NBD
int sockfd[2];

Loading…
Cancel
Save