X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=verify.c;h=3cda3267c9f7262f88aa59f71dfb33614d0fcdf6;hp=59a9ddedb6157c0e5a31171069fdb0bab6195bbf;hb=e28218f3017e5eb156d3a4a6e7b33651dc022cea;hpb=fc74ac1d749c977308016eb22c8658a9a5ac7989 diff --git a/verify.c b/verify.c index 59a9dded..3cda3267 100644 --- a/verify.c +++ b/verify.c @@ -112,7 +112,6 @@ static inline unsigned int __hdr_size(int verify_type) switch (verify_type) { case VERIFY_NONE: case VERIFY_NULL: - case VERIFY_PATTERN: len = 0; break; case VERIFY_MD5: @@ -406,6 +405,19 @@ int verify_io_u(struct thread_data *td, struct io_u *io_u) return EIO; } + if (td->o.verify_pattern_bytes) { + ret = verify_io_u_pattern(td->o.verify_pattern, + td->o.verify_pattern_bytes, + p + hdr_size, + hdr_inc - hdr_size, + hdr_size % 4); + if (ret) + log_err("fio: verify failed at %llu/%u\n", + io_u->offset + hdr_num * hdr->len, + hdr->len); + continue; + } + switch (hdr->verify_type) { case VERIFY_MD5: ret = verify_io_u_md5(hdr, io_u, hdr_num); @@ -431,17 +443,6 @@ int verify_io_u(struct thread_data *td, struct io_u *io_u) case VERIFY_META: ret = verify_io_u_meta(hdr, td, io_u, hdr_num); break; - case VERIFY_PATTERN: - ret = verify_io_u_pattern(td->o.verify_pattern, - td->o.verify_pattern_bytes, - p + hdr_size, - hdr_inc - hdr_size, - hdr_size % 4); - if (ret) - log_err("fio: verify failed at %llu/%u\n", - io_u->offset + hdr_num * hdr->len, - hdr->len); - break; default: log_err("Bad verify type %u\n", hdr->verify_type); ret = EINVAL; @@ -580,8 +581,6 @@ void populate_verify_io_u(struct thread_data *td, struct io_u *io_u) case VERIFY_META: fill_meta(hdr, td, io_u, header_num); break; - case VERIFY_PATTERN: - break; default: log_err("fio: bad verify type: %d\n", td->o.verify); assert(0);