summaryrefslogtreecommitdiff
path: root/fs/orangefs/devorangefs-req.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-08-09 22:59:26 +0300
committerMartin Brandenburg <martin@omnibond.com>2016-08-09 23:25:51 +0300
commitf2ee3b759593c184f1249e03d613a84b4b69db2b (patch)
tree6e6bef9e829fa929c9858e6e906e843b703a2be3 /fs/orangefs/devorangefs-req.c
parenta21aae3bb15a1d08040bdcf5a73504c0da9f5080 (diff)
downloadlinux-f2ee3b759593c184f1249e03d613a84b4b69db2b.tar.xz
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>
Diffstat (limited to 'fs/orangefs/devorangefs-req.c')
-rw-r--r--fs/orangefs/devorangefs-req.c10
1 files changed, 10 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 @@
/* this file implements the /dev/pvfs2-req device node */
+uint32_t userspace_version;
+
static int open_access_count;
#define DUMP_DEVICE_ERROR() \
@@ -387,6 +389,13 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
return -EPROTO;
}
+ if (!userspace_version) {
+ userspace_version = head.version;
+ } else if (userspace_version != head.version) {
+ gossip_err("Error: userspace version changes\n");
+ return -EPROTO;
+ }
+
/* remove the op from the in progress hash table */
op = orangefs_devreq_remove_op(head.tag);
if (!op) {
@@ -527,6 +536,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
gossip_debug(GOSSIP_DEV_DEBUG,
"pvfs2-client-core: device close complete\n");
open_access_count = 0;
+ userspace_version = 0;
mutex_unlock(&devreq_mutex);
return 0;
}