From: Vincent Fu Date: Fri, 15 Jun 2018 21:52:43 +0000 (-0600) Subject: options: check for conflict between trims and readonly option X-Git-Tag: fio-3.8~27^2~2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=d81d0f992bb3f12be22311b81b6b0b209e42c33b;ds=sidebyside options: check for conflict between trims and readonly option When processing the readwrite option, make sure that trim operations are not requested if readonly is set. --- diff --git a/options.c b/options.c index 0c4f89c4..a174e2cd 100644 --- a/options.c +++ b/options.c @@ -1555,9 +1555,9 @@ static int rw_verify(const struct fio_option *o, void *data) { struct thread_data *td = cb_data_to_td(data); - if (read_only && td_write(td)) { - log_err("fio: job <%s> has write bit set, but fio is in" - " read-only mode\n", td->o.name); + if (read_only && (td_write(td) || td_trim(td))) { + log_err("fio: job <%s> has write or trim bit set, but" + " fio is in read-only mode\n", td->o.name); return 1; }