Changeset 4617
- Timestamp:
- 10/06/05 09:43:04 (8 years ago)
- Location:
- trunk
- Files:
-
- 9 modified
-
ChangeLog (modified) (2 diffs)
-
doc/add-server-req (modified) (1 diff)
-
include/pvfs2-mgmt.h (modified) (1 diff)
-
include/pvfs2-types.h (modified) (1 diff)
-
src/proto/PINT-reqproto-encode.c (modified) (3 diffs)
-
src/proto/PINT-reqproto-module.h (modified) (1 diff)
-
src/proto/endecode-funcs.h (modified) (1 diff)
-
src/proto/pvfs2-attr.h (modified) (1 diff)
-
src/proto/pvfs2-req-proto.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r4605 r4617 3 3 ----------------------- 4 4 5 pvfs2-1. 2.1-pre15 pvfs2-1.3.0-pre1 6 6 =============== 7 7 - Murali Vilayannur contributed extened attribute support to the VFS interface … … 11 11 - Phil also contributed improvements to the request processor which should 12 12 help speed up some concurrent workloads. 13 - Phil further contributed protocol versioning to PVFS2. Major version 14 changes are incompatible up or down. New clients can't talk to old servers, 15 but new servers can talk to old clients. 13 16 14 17 pvfs2-1.2.0 -
trunk/doc/add-server-req
r4510 r4617 15 15 add a stub in include/pvfs2-encode-stubs.h 16 16 17 2b) update the protocol version number 18 src/proto/pvfs2-req-proto.h 19 increment PVFS2_PROTO_MINOR, assuming that the 20 addition of this new request does not break backwards 21 compatibility for other request types 22 17 23 3) add entries to decode/encode functions 18 24 src/proto/PINT-le-bytefield.c -
trunk/include/pvfs2-mgmt.h
r4574 r4617 3 3 * 4 4 * See COPYING in top-level directory. 5 */ 6 /* NOTE: if you make any changes to the encoding definitions in this file, 7 * please update the PVFS2_PROTO_VERSION in pvfs2-req-proto.h accordingly 5 8 */ 6 9 -
trunk/include/pvfs2-types.h
r4593 r4617 3 3 * 4 4 * See COPYING in top-level directory. 5 */ 6 /* NOTE: if you make any changes to the encoding definitions in this file, 7 * please update the PVFS2_PROTO_VERSION in pvfs2-req-proto.h accordingly 5 8 */ 6 9 -
trunk/src/proto/PINT-reqproto-encode.c
r4536 r4617 63 63 /* header prepended to all messages of this type */ 64 64 *((int32_t*)&(le_bytefield_table.generic_header[0])) = 65 htobmi32(PVFS _RELEASE_NR);65 htobmi32(PVFS2_PROTO_VERSION); 66 66 *((int32_t*)&(le_bytefield_table.generic_header[4])) = 67 67 htobmi32(ENCODING_LE_BFIELD); 68 68 69 le_bytefield_table.enc_type = ENCODING_LE_BFIELD; 69 70 ret = 0; 70 71 } … … 166 167 int ret; 167 168 int32_t enc_type_recved, proto_ver_recved; 169 int proto_major_recved, proto_minor_recved; 168 170 169 171 gossip_debug(GOSSIP_ENDECODE_DEBUG,"PINT_decode\n"); 170 /* compare the header of the incoming buffer against the precalculated 171 * header associated with each module 172 */ 172 173 /* sanity check size */ 174 if(size < PINT_ENC_GENERIC_HEADER_SIZE) 175 { 176 gossip_err("Error: poorly formatted protocol message received.\n"); 177 gossip_err(" Too small: message only %Ld bytes.\n", 178 Ld(size)); 179 return(-PVFS_EPROTO); 180 } 181 182 /* pull the encoding type and protocol version out */ 183 proto_ver_recved = (int)bmitoh32(*((int32_t*)input_buffer)); 184 enc_type_recved = bmitoh32(*((int32_t*)enc_type_ptr)); 185 proto_major_recved = proto_ver_recved / 1000; 186 proto_minor_recved = proto_ver_recved - (proto_major_recved*1000); 187 188 /* check encoding type */ 189 if(enc_type_recved != ENCODING_LE_BFIELD) 190 { 191 gossip_err("Error: poorly formatted protocol message received.\n"); 192 gossip_err(" Encoding type mismatch: received type %d when " 193 "expecting %d.\n", (int)enc_type_recved, 194 ENCODING_LE_BFIELD); 195 return(-PVFS_EPROTONOSUPPORT); 196 } 197 198 /* check various protocol version possibilities */ 199 if(proto_major_recved != PVFS2_PROTO_MAJOR) 200 { 201 gossip_err("Error: poorly formatted protocol message received.\n"); 202 gossip_err(" Protocol version mismatch: received major version %d when " 203 "expecting %d.\n", (int)proto_major_recved, 204 PVFS2_PROTO_MAJOR); 205 gossip_err(" Please verify your PVFS2 installation and make sure " 206 "that the version is\n consistent.\n"); 207 return(-PVFS_EPROTONOSUPPORT); 208 } 209 210 if((input_type == PINT_DECODE_REQ) && 211 (proto_minor_recved > PVFS2_PROTO_MINOR)) 212 { 213 gossip_err("Error: poorly formatted protocol message received.\n"); 214 gossip_err(" Protocol version mismatch: request has minor version %d when " 215 "expecting %d or lower.\n", (int)proto_minor_recved, 216 PVFS2_PROTO_MINOR); 217 gossip_err(" Client is too new for server.\n"); 218 gossip_err(" Please verify your PVFS2 installation and make sure " 219 "that the version is\n consistent.\n"); 220 return(-PVFS_EPROTONOSUPPORT); 221 } 222 223 if((input_type == PINT_DECODE_RESP) && 224 (proto_minor_recved < PVFS2_PROTO_MINOR)) 225 { 226 gossip_err("Error: poorly formatted protocol message received.\n"); 227 gossip_err(" Protocol version mismatch: request has minor version %d when " 228 "expecting %d or higher.\n", (int)proto_minor_recved, 229 PVFS2_PROTO_MINOR); 230 gossip_err(" Server is too old for client.\n"); 231 gossip_err(" Please verify your PVFS2 installation and make sure " 232 "that the version is\n consistent.\n"); 233 return(-PVFS_EPROTONOSUPPORT); 234 } 235 173 236 for(i=0; i<ENCODING_TABLE_SIZE; i++) 174 237 { 175 if(PINT_encoding_table[i] && !(memcmp(input_buffer, 176 PINT_encoding_table[i]->generic_header, 177 PINT_ENC_GENERIC_HEADER_SIZE))) 178 { 238 if(PINT_encoding_table[i] && (PINT_encoding_table[i]->enc_type 239 == enc_type_recved)) 240 { 179 241 struct PVFS_server_req* tmp_req; 180 242 struct PVFS_server_req* tmp_resp; 181 target_msg->enc_type = bmitoh32(*((int32_t*)enc_type_ptr));243 target_msg->enc_type = enc_type_recved; 182 244 if(input_type == PINT_DECODE_REQ) 183 245 { … … 215 277 gossip_err("Error: poorly formatted protocol message received.\n"); 216 278 217 enc_type_recved = bmitoh32(*((int32_t*)enc_type_ptr));218 proto_ver_recved = (int)bmitoh32(*((int32_t*)input_buffer));219 220 if(size < PINT_ENC_GENERIC_HEADER_SIZE)221 {222 gossip_err(" Too small: message only %Ld bytes.\n",223 Ld(size));224 return(-PVFS_EPROTO);225 }226 227 if(enc_type_recved != ENCODING_LE_BFIELD)228 {229 gossip_err(" Encoding type mismatch: received type %d when "230 "expecting %d.\n", (int)enc_type_recved,231 ENCODING_LE_BFIELD);232 }233 234 if(proto_ver_recved != PVFS_RELEASE_NR)235 {236 gossip_err(" Protocol version mismatch: received version %d when "237 "expecting version %d.\n", (int)proto_ver_recved,238 PVFS_RELEASE_NR);239 gossip_err(" Please verify your PVFS2 installation and make sure "240 "that the version is consistent.\n");241 }242 243 279 return(-PVFS_EPROTONOSUPPORT); 244 280 } -
trunk/src/proto/PINT-reqproto-module.h
r3784 r4617 51 51 void (*init_fun) (void); 52 52 char generic_header[PINT_ENC_GENERIC_HEADER_SIZE]; 53 int enc_type; 53 54 } PINT_encoding_table_values; 54 55 -
trunk/src/proto/endecode-funcs.h
r4539 r4617 6 6 * Defines for macros related to wire encoding and decoding. Only included 7 7 * by include/pvfs2-encode-stubs.h by core encoding users. 8 */ 9 /* NOTE: if you make any changes to the code contained in this file, please 10 * update the PVFS2_PROTO_VERSION in pvfs2-req-proto.h accordingly 8 11 */ 9 12 #ifndef __SRC_PROTO_ENDECODE_FUNCS_H -
trunk/src/proto/pvfs2-attr.h
r4570 r4617 3 3 * 4 4 * See COPYING in top-level directory. 5 */ 6 /* NOTE: if you make any changes to the code contained in this file, please 7 * update the PVFS2_PROTO_VERSION in pvfs2-req-proto.h accordingly 5 8 */ 6 9 -
trunk/src/proto/pvfs2-req-proto.h
r4539 r4617 3 3 * 4 4 * See COPYING in top-level directory. 5 */ 6 /* NOTE: if you make any changes to the code contained in this file, please 7 * update the PVFS2_PROTO_VERSION accordingly 5 8 */ 6 9 … … 15 18 #include "pvfs2-mgmt.h" 16 19 17 /* release number: This is a base-10, 5 digit number, with one digit18 * for the most significant version number and two for the last two19 * (e.g. 1.5.6 => 10506)20 /* update PVFS2_PROTO_MAJOR on wire protocol changes that break backwards 21 * compatibility (such as changing the semantics or protocol fields for an 22 * existing request type) 20 23 */ 21 #define PVFS_RELEASE_NR ((PVFS2_VERSION_MAJOR * 10000) + \ 22 (PVFS2_VERSION_MINOR * 100) + PVFS2_VERSION_SUB) 24 #define PVFS2_PROTO_MAJOR 1 25 /* update PVFS2_PROTO_MINOR on wire protocol changes that preserve backwards 26 * compatibility (such as adding a new request type) 27 */ 28 #define PVFS2_PROTO_MINOR 1 29 #define PVFS2_PROTO_VERSION ((PVFS2_PROTO_MAJOR*1000)+(PVFS2_PROTO_MINOR)) 23 30 24 31 enum PVFS_server_op
