Passing io_size > 100% results in semi-infinite loop, anyway.
Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
will perform I/O within the first 20GiB but exit when 5GiB have been
done. The opposite is also possible \-\- if \fBsize\fR is set to 20GiB,
and \fBio_size\fR is set to 40GiB, then fio will do 40GiB of I/O within
-the 0..20GiB region.
+the 0..20GiB region. Value can be set as percentage: \fBio_size\fR=N%.
+In this case \fBio_size\fR multiplies \fBsize\fR= value.
.TP
.BI filesize \fR=\fPirange(int)
Individual file sizes. May be a range, in which case fio will select sizes
struct thread_data *td = cb_data_to_td(data);
unsigned long long v = *__val;
- if (parse_is_percent(v)) {
+ if (parse_is_percent_uncapped(v)) {
td->o.io_size = 0;
td->o.io_size_percent = -1ULL - v;
+ if (td->o.io_size_percent > 100) {
+ log_err("fio: io_size values greater than 100%% aren't supported\n");
+ return 1;
+ }
dprint(FD_PARSE, "SET io_size_percent %d\n",
td->o.io_size_percent);
} else
return val <= -1ULL && val >= (-1ULL - 100ULL);
}
+static inline int parse_is_percent_uncapped(unsigned long long val)
+{
+ return (long long)val <= -1;
+}
+
struct print_option {
struct flist_head list;
char *name;