The test writes 20M and then splices just over 1M (13M is intended,
but there's a 1024*0124 typo). Fix the type and reduce the size of the
dataset to make it run faster - cli_splice works with 1M chunks
(SPLICE_BLOCK_SIZE), and the reproducer only requires that the splice
size is not chunk-aligned.
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jul 14 00:14:13 CEST 2018 on sn-devel-144
NTSTATUS status;
uint16_t fnum1 = UINT16_MAX;
uint16_t fnum2 = UINT16_MAX;
NTSTATUS status;
uint16_t fnum1 = UINT16_MAX;
uint16_t fnum2 = UINT16_MAX;
- size_t file_size = 20*1024*1024;
- size_t splice_size = 13*1024*0124 + 713;
+ size_t file_size = 2*1024*1024;
+ size_t splice_size = 1*1024*1024 + 713;
MD5_CTX md5_ctx;
uint8_t digest1[16], digest2[16];
off_t written = 0;
MD5_CTX md5_ctx;
uint8_t digest1[16], digest2[16];
off_t written = 0;
/* Fill it with random numbers. */
generate_random_buffer(buf, file_size);
/* Fill it with random numbers. */
generate_random_buffer(buf, file_size);
- /* MD5 the first 13MB + 713 bytes. */
+ /* MD5 the first 1MB + 713 bytes. */
MD5Init(&md5_ctx);
MD5Update(&md5_ctx, buf, splice_size);
MD5Final(digest1, &md5_ctx);
MD5Init(&md5_ctx);
MD5Update(&md5_ctx, buf, splice_size);
MD5Final(digest1, &md5_ctx);
- /* Now splice 13MB + 713 bytes. */
+ /* Now splice 1MB + 713 bytes. */
status = cli_splice(cli1,
cli1,
fnum1,
status = cli_splice(cli1,
cli1,
fnum1,
- /* MD5 the first 13MB + 713 bytes. */
+ /* MD5 the first 1MB + 713 bytes. */
MD5Init(&md5_ctx);
MD5Update(&md5_ctx, buf, splice_size);
MD5Final(digest2, &md5_ctx);
MD5Init(&md5_ctx);
MD5Update(&md5_ctx, buf, splice_size);
MD5Final(digest2, &md5_ctx);