aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-08-09 15:59:26 -0400
committerMartin Brandenburg <martin@omnibond.com>2016-08-09 16:25:51 -0400
commitf2ee3b759593c184f1249e03d613a84b4b69db2b (patch)
tree6e6bef9e829fa929c9858e6e906e843b703a2be3
parenta21aae3bb15a1d08040bdcf5a73504c0da9f5080 (diff)
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>
-rw-r--r--fs/orangefs/devorangefs-req.c10
-rw-r--r--fs/orangefs/orangefs-kernel.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index a287a66d94e3..7c40e653e526 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -17,6 +17,8 @@
17 17
18/* this file implements the /dev/pvfs2-req device node */ 18/* this file implements the /dev/pvfs2-req device node */
19 19
20uint32_t userspace_version;
21
20static int open_access_count; 22static int open_access_count;
21 23
22#define DUMP_DEVICE_ERROR() \ 24#define DUMP_DEVICE_ERROR() \
@@ -387,6 +389,13 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
387 return -EPROTO; 389 return -EPROTO;
388 } 390 }
389 391
392 if (!userspace_version) {
393 userspace_version = head.version;
394 } else if (userspace_version != head.version) {
395 gossip_err("Error: userspace version changes\n");
396 return -EPROTO;
397 }
398
390 /* remove the op from the in progress hash table */ 399 /* remove the op from the in progress hash table */
391 op = orangefs_devreq_remove_op(head.tag); 400 op = orangefs_devreq_remove_op(head.tag);
392 if (!op) { 401 if (!op) {
@@ -527,6 +536,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
527 gossip_debug(GOSSIP_DEV_DEBUG, 536 gossip_debug(GOSSIP_DEV_DEBUG,
528 "pvfs2-client-core: device close complete\n"); 537 "pvfs2-client-core: device close complete\n");
529 open_access_count = 0; 538 open_access_count = 0;
539 userspace_version = 0;
530 mutex_unlock(&devreq_mutex); 540 mutex_unlock(&devreq_mutex);
531 return 0; 541 return 0;
532} 542}
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h
index 633c07a6e3d8..ff3566a8388f 100644
--- a/fs/orangefs/orangefs-kernel.h
+++ b/fs/orangefs/orangefs-kernel.h
@@ -506,6 +506,8 @@ ssize_t orangefs_inode_read(struct inode *inode,
506/* 506/*
507 * defined in devorangefs-req.c 507 * defined in devorangefs-req.c
508 */ 508 */
509extern uint32_t userspace_version;
510
509int orangefs_dev_init(void); 511int orangefs_dev_init(void);
510void orangefs_dev_cleanup(void); 512void orangefs_dev_cleanup(void);
511int is_daemon_in_service(void); 513int is_daemon_in_service(void);