FIO参数
ignore_error=str Sometimes you want to ignore some errors during test in that case you can specify error list for each error type. ignore_error=READ_ERR_LIST,WRITE_ERR_LIST,VERIFY_ERR_LIST errors for given error type is separated with ':'. Error may be symbol ('ENOSPC', 'ENOMEM') or an integer. Example: ignore_error=EAGAIN,ENOSPC:122 . This option will ignore EAGAIN from READ, and ENOSPC and 122(EDQUOT) from WRITE. 意思是这个参数有三个域 分别是读,写,verify 要想让着三个类型忽略某种错需要后面跟上:加错误类型。而错误类型就是OS的Error的返回码
{ .name = "ignore_error", .type = FIO_OPT_STR, .cb = str_ignore_error_cb, .off1 = td_var_offset(ignore_error_nr), .help = "Set a specific list of errors to ignore", .parent = "rw", .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_ERR, }
continue_on_error=verify, 当出现error是忽略并继续进行测试。
{ .name = "continue_on_error", .lname = "Continue on error", .type = FIO_OPT_STR, .off1 = td_var_offset(continue_on_error), .help = "Continue on non-fatal errors during IO", .def = "none", .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_ERR, .posval = { { .ival = "none", .oval = ERROR_TYPE_NONE, .help = "Exit when an error is encountered", }, { .ival = "read", .oval = ERROR_TYPE_READ, .help = "Continue on read errors only", }, { .ival = "write", .oval = ERROR_TYPE_WRITE, .help = "Continue on write errors only", }, { .ival = "io", .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE, .help = "Continue on any IO errors", }, { .ival = "verify", .oval = ERROR_TYPE_VERIFY, .help = "Continue on verify errors only", }, { .ival = "all", .oval = ERROR_TYPE_ANY, .help = "Continue on all io and verify errors", }, { .ival = "0", .oval = ERROR_TYPE_NONE, .help = "Alias for 'none'", }, { .ival = "1", .oval = ERROR_TYPE_ANY, .help = "Alias for 'all'", }, }, }
FIo 验证数据一致性必须所有的数据都写满才行,否则校验就会失败。
struct verify_header { uint16_t magic; uint16_t verify_type; uint32_t len; uint64_t rand_seed; uint32_t crc32; }; static int verify_header(struct io_u *io_u, struct verify_header *hdr, unsigned int hdr_num, unsigned int hdr_len);
verify_header()
check verify_header 的 magic是否匹配 ;#define FIO_HDR_MAGIC0xacca;
check len 和hdr_len要相等。
hdr->rand_seed 和 io_u->rand_seed要相等。
根据hdr里的内容,重新计算crc,看和hdr->crc32是否一致。
crc = fio_crc32c(p, offsetof(struct verify_header, crc32));
/**/
crc = fio_crc32c(p, ((size_t) &((struct verify_header *)0)->crc32));
如果匹配,header校验成功.
static void populate_hdr(struct thread_data *td, struct io_u *io_u, struct verify_header *hdr, unsigned int header_num, unsigned int header_len)
为hdr各个成员赋值。
data_len = header_len - hdr_size(hdr);
/*The function do fill the verify data(verify_header + crc32) at the address 'struct verify_header *hdr'*/
static void fill_pattern_headers(struct thread_data *td, struct io_u *io_u, unsigned long seed, int use_seed)