The hash function used by the integrity test was designed specifically such that with < (2^32) blocks and < (2^32) read/write operations, it can accurately guess how the bad data returned was generated. This patch uses this huersistic to provide a guess as to what is wrong. EG if it prints out a correct block number but a bad sequence number, it is likely the server is disordering writes or has missed writes.
Available from git.alex.org.uk as usual. Signed-off-by: Alex Bligh <[email protected]> --- nbd-tester-client.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/nbd-tester-client.c b/nbd-tester-client.c index f2ebffc..9e85c83 100644 --- a/nbd-tester-client.c +++ b/nbd-tester-client.c @@ -1087,7 +1087,12 @@ int integrity_test(gchar* hostname, int port, char* name, int sock, if (checkbuf(dbuf, blkhash[blknum], blknum)) { retval=-1; - snprintf(errstr, errstr_len, "Bad reply data: seq %08x", blkhash[blknum]); + snprintf(errstr, errstr_len, "Bad reply data: I wanted blk %08x, seq %08x but I got (at a guess) blk %08x, seq %08x", + (unsigned int) blknum, + blkhash[blknum], + ((uint32_t *)(dbuf))[0], + ((uint32_t *)(dbuf))[1] + ); goto err_open; } -- 1.7.4.1 ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 _______________________________________________ Nbd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nbd-general
