Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

orangefs: record userspace version for feature compatbility

The client reports its version to the kernel on startup. We already test
that it is above the minimum version. Now we record it in a global
variable so code elsewhere can consult it before making a request the
client may not understand.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>

+12
+10
fs/orangefs/devorangefs-req.c
··· 17 17 18 18 /* this file implements the /dev/pvfs2-req device node */ 19 19 20 + uint32_t userspace_version; 21 + 20 22 static int open_access_count; 21 23 22 24 #define DUMP_DEVICE_ERROR() \ ··· 389 387 return -EPROTO; 390 388 } 391 389 390 + if (!userspace_version) { 391 + userspace_version = head.version; 392 + } else if (userspace_version != head.version) { 393 + gossip_err("Error: userspace version changes\n"); 394 + return -EPROTO; 395 + } 396 + 392 397 /* remove the op from the in progress hash table */ 393 398 op = orangefs_devreq_remove_op(head.tag); 394 399 if (!op) { ··· 536 527 gossip_debug(GOSSIP_DEV_DEBUG, 537 528 "pvfs2-client-core: device close complete\n"); 538 529 open_access_count = 0; 530 + userspace_version = 0; 539 531 mutex_unlock(&devreq_mutex); 540 532 return 0; 541 533 }
+2
fs/orangefs/orangefs-kernel.h
··· 506 506 /* 507 507 * defined in devorangefs-req.c 508 508 */ 509 + extern uint32_t userspace_version; 510 + 509 511 int orangefs_dev_init(void); 510 512 void orangefs_dev_cleanup(void); 511 513 int is_daemon_in_service(void);