projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gettime: if setaffinity fails, print the errno error
[fio.git]
/
verify.c
diff --git
a/verify.c
b/verify.c
index 2ae03f85fbea88f4e0f24ff33a4480d124d27e26..b6793d7da76a7f98d68df2847de727ee359cd3dc 100644
(file)
--- a/
verify.c
+++ b/
verify.c
@@
-472,6
+472,7
@@
static int verify_io_u_sha256(struct verify_header *hdr, struct vcont *vc)
fio_sha256_init(&sha256_ctx);
fio_sha256_update(&sha256_ctx, p, hdr->len - hdr_size(hdr));
fio_sha256_init(&sha256_ctx);
fio_sha256_update(&sha256_ctx, p, hdr->len - hdr_size(hdr));
+ fio_sha256_final(&sha256_ctx);
if (!memcmp(vh->sha256, sha256_ctx.buf, sizeof(sha256)))
return 0;
if (!memcmp(vh->sha256, sha256_ctx.buf, sizeof(sha256)))
return 0;
@@
-497,6
+498,7
@@
static int verify_io_u_sha1(struct verify_header *hdr, struct vcont *vc)
fio_sha1_init(&sha1_ctx);
fio_sha1_update(&sha1_ctx, p, hdr->len - hdr_size(hdr));
fio_sha1_init(&sha1_ctx);
fio_sha1_update(&sha1_ctx, p, hdr->len - hdr_size(hdr));
+ fio_sha1_final(&sha1_ctx);
if (!memcmp(vh->sha1, sha1_ctx.H, sizeof(sha1)))
return 0;
if (!memcmp(vh->sha1, sha1_ctx.H, sizeof(sha1)))
return 0;
@@
-627,6
+629,7
@@
static int verify_io_u_md5(struct verify_header *hdr, struct vcont *vc)
fio_md5_init(&md5_ctx);
fio_md5_update(&md5_ctx, p, hdr->len - hdr_size(hdr));
fio_md5_init(&md5_ctx);
fio_md5_update(&md5_ctx, p, hdr->len - hdr_size(hdr));
+ fio_md5_final(&md5_ctx);
if (!memcmp(vh->md5_digest, md5_ctx.hash, sizeof(hash)))
return 0;
if (!memcmp(vh->md5_digest, md5_ctx.hash, sizeof(hash)))
return 0;
@@
-893,6
+896,7
@@
static void fill_sha256(struct verify_header *hdr, void *p, unsigned int len)
fio_sha256_init(&sha256_ctx);
fio_sha256_update(&sha256_ctx, p, len);
fio_sha256_init(&sha256_ctx);
fio_sha256_update(&sha256_ctx, p, len);
+ fio_sha256_final(&sha256_ctx);
}
static void fill_sha1(struct verify_header *hdr, void *p, unsigned int len)
}
static void fill_sha1(struct verify_header *hdr, void *p, unsigned int len)
@@
-904,6
+908,7
@@
static void fill_sha1(struct verify_header *hdr, void *p, unsigned int len)
fio_sha1_init(&sha1_ctx);
fio_sha1_update(&sha1_ctx, p, len);
fio_sha1_init(&sha1_ctx);
fio_sha1_update(&sha1_ctx, p, len);
+ fio_sha1_final(&sha1_ctx);
}
static void fill_crc7(struct verify_header *hdr, void *p, unsigned int len)
}
static void fill_crc7(struct verify_header *hdr, void *p, unsigned int len)
@@
-950,6
+955,7
@@
static void fill_md5(struct verify_header *hdr, void *p, unsigned int len)
fio_md5_init(&md5_ctx);
fio_md5_update(&md5_ctx, p, len);
fio_md5_init(&md5_ctx);
fio_md5_update(&md5_ctx, p, len);
+ fio_md5_final(&md5_ctx);
}
static void populate_hdr(struct thread_data *td, struct io_u *io_u,
}
static void populate_hdr(struct thread_data *td, struct io_u *io_u,
@@
-1341,7
+1347,8
@@
struct all_io_list *get_all_io_list(int save_mask, size_t *sz)
s->rand.s[1] = cpu_to_le32(td->random_state.s2);
s->rand.s[2] = cpu_to_le32(td->random_state.s3);
s->rand.s[3] = 0;
s->rand.s[1] = cpu_to_le32(td->random_state.s2);
s->rand.s[2] = cpu_to_le32(td->random_state.s3);
s->rand.s[3] = 0;
- strncpy((char *) s->name, td->o.name, sizeof(s->name));
+ s->name[sizeof(s->name) - 1] = '\0';
+ strncpy((char *) s->name, td->o.name, sizeof(s->name) - 1);
next = io_list_next(s);
}
next = io_list_next(s);
}
@@
-1539,10
+1546,12
@@
int verify_state_should_stop(struct thread_data *td, struct io_u *io_u)
return 0;
/*
return 0;
/*
- * If we're not into the window of issues - depth yet, continue
+ * If we're not into the window of issues - depth yet, continue. If
+ * issue is shorter than depth, do check.
*/
*/
- if (td->io_blocks[DDIR_READ] < s->depth ||
- s->numberio - td->io_blocks[DDIR_READ] > s->depth)
+ if ((td->io_blocks[DDIR_READ] < s->depth ||
+ s->numberio - td->io_blocks[DDIR_READ] > s->depth) &&
+ s->numberio > s->depth)
return 0;
/*
return 0;
/*