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

This commit is contained in:
Vitaliy Filippov
2022-01-23 23:03:42 +03:00
parent 2a0b881685
commit 0757ba630a
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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;