diff --git a/src/bcast/file_bcast.c b/src/bcast/file_bcast.c index bdae51ff46cbed7d9676685a9fdf12a8be102664..4325bb5456a3f554a3dcd2634ef826698e7c9209 100644 --- a/src/bcast/file_bcast.c +++ b/src/bcast/file_bcast.c @@ -415,7 +415,7 @@ static int _bcast_file(struct bcast_parameters *params) debug("block %d, size %u", bcast_msg.block_no, bcast_msg.block_len); bcast_msg.compress = params->compress; - bcast_msg.orig_len = orig_len; + bcast_msg.uncomp_len = orig_len; bcast_msg.block = buffer; if (!more) bcast_msg.last_block = 1; diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index 08b74bcf21c2d4a422d54b175199fe2a88e8c629..b743e4da4813cf86f6b088912bc3df5c25c69825 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -1081,7 +1081,8 @@ typedef struct file_bcast_msg { time_t mtime; /* last modification time for dest file */ sbcast_cred_t *cred; /* credential for the RPC */ uint32_t block_len; /* length of this data block */ - uint32_t orig_len; /* uncompressed length of this data block */ + uint32_t block_offset; /* offset for this data block */ + uint32_t uncomp_len; /* uncompressed length of this data block */ char *block; /* data for this block */ } file_bcast_msg_t; diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index 9aa1bed3f4c5aea29a30449732867ca9f8c90b1d..a508b433bc1d3abe4d9fe18d428c13c7462a72dd 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -13485,7 +13485,8 @@ static void _pack_file_bcast(file_bcast_msg_t * msg , Buf buffer, packstr ( msg->fname, buffer ); pack32 ( msg->block_len, buffer ); - pack32(msg->orig_len, buffer); + pack32(msg->uncomp_len, buffer); + pack32(msg->block_offset, buffer); packmem ( msg->block, msg->block_len, buffer ); pack_sbcast_cred( msg->cred, buffer ); } else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) { @@ -13535,7 +13536,8 @@ static int _unpack_file_bcast(file_bcast_msg_t ** msg_ptr , Buf buffer, safe_unpackstr_xmalloc ( & msg->fname, &uint32_tmp, buffer ); safe_unpack32 ( & msg->block_len, buffer ); - safe_unpack32(&msg->orig_len, buffer); + safe_unpack32(&msg->uncomp_len, buffer); + safe_unpack32(&msg->block_offset, buffer); safe_unpackmem_xmalloc ( & msg->block, &uint32_tmp , buffer ) ; if ( uint32_tmp != msg->block_len ) goto unpack_error; diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c index c77447af7e31017c97ba54c3f6bb44f3c8487876..baac8c9d86edccc2816037d7639475c15a0efe1c 100644 --- a/src/slurmd/slurmd/req.c +++ b/src/slurmd/slurmd/req.c @@ -3474,7 +3474,7 @@ static int _decompress_data_zlib(file_bcast_msg_t *req) unsigned char zlib_out[chunk]; int buf_in_offset = 0; int buf_out_offset = 0; - char *out_buf = xmalloc(req->orig_len); + char *out_buf = xmalloc(req->uncomp_len); /* Perform decompression */ strm.zalloc = Z_NULL; @@ -3522,13 +3522,13 @@ static int _decompress_data_zlib(file_bcast_msg_t *req) static int _decompress_data_lz4(file_bcast_msg_t *req) { #if HAVE_LZ4 - char *out_buf = xmalloc(req->orig_len); + char *out_buf = xmalloc(req->uncomp_len); int out_len; - out_len = LZ4_decompress_safe(req->block, out_buf, req->block_len, req->orig_len); + out_len = LZ4_decompress_safe(req->block, out_buf, req->block_len, req->uncomp_len); xfree(req->block); req->block = out_buf; - if (req->orig_len != out_len) { + if (req->uncomp_len != out_len) { error("lz4 decompression error, original block length != decompressed length"); return -1; }