rc = system(cmd);
if (rc < 0) {
- prt("%s: %d\n", cmd, errno);
+ prt("mirror op %d: %s: %d\n", op, cmd, errno);
report_failure(184);
} else if (WIFEXITED(rc)) {
rc = WEXITSTATUS(rc);
if (rc > 0) {
- prt("%s: %d\n", cmd, rc);
+ prt("mirror op %d: %s: %d\n", op, cmd, rc);
snprintf(cmd, sizeof(cmd),
"lfs mirror verify -v %s", tf->path);
rc = system(cmd);
error "setstripe $tf failed"
FSXNUM=${FSXNUM:-1000}
- $FSX -p 5 -N $FSXNUM -S 0 -M $tf || error "fsx FLR file $tf failed"
+ $FSX -p 1 -N $FSXNUM -S 0 -M $tf || error "fsx FLR file $tf failed"
}
run_test 70a "flr mode fsx test"
rc = -EINVAL;
fprintf(stderr,
- "%s: chunk "DEXT" has different checksum value on mirror %u and mirror %u.\n",
+ "%s: chunk "DEXT" has different checksum value on mirror %u:%lx and mirror %u:%lx.\n",
progname, PEXT(&chunk->chunk),
- chunk->mirror_id[0],
- chunk->mirror_id[i]);
+ chunk->mirror_id[0], crc_array[0],
+ chunk->mirror_id[i], crc_array[i]);
+ print_checksums(chunk, crc_array, pos, buflen);
}
}
ssize_t bytes_read;
size_t to_read;
size_t to_write;
+ size_t data_size;
if (pos >= data_end) {
off_t tmp_off;
- size_t data_size;
if (pos >= mirror_end || !src) {
rc = llapi_mirror_find(layout, pos, end,
else
to_punch = data_off - cur_pos;
- if (comp_array[i].lrc_end == OBD_OBJECT_EOF) {
+ if (comp_array[i].lrc_end == OBD_OBJECT_EOF)
/* the last component can be truncated
* safely
*/
rc = llapi_mirror_truncate(fd, mid,
cur_pos);
- /* hole at the end of file, so just
- * truncate up to set size.
- */
- if (!rc && data_off == data_end)
- rc = llapi_mirror_truncate(fd,
+ else if (data_size)
+ rc = llapi_mirror_punch(fd, mid,
+ cur_pos, to_punch);
+ /**
+ * hole at the end of file, so just truncate up
+ * to set size.
+ */
+ if (!rc && data_off == data_end && !data_size)
+ rc = llapi_mirror_truncate(fd,
mid, data_end);
- } else {
- rc = llapi_mirror_punch(fd,
- comp_array[i].lrc_mirror_id,
- cur_pos, to_punch);
- }
/* if failed then read failed hole range */
if (rc < 0) {
rc = 0;