summaryrefslogtreecommitdiff
path: root/fs/orangefs/devorangefs-req.c
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-09-28 21:47:29 +0300
committerMartin Brandenburg <martin@omnibond.com>2016-09-28 21:47:29 +0300
commitf808e138c0abd99bfce90ec8d4ef6406c2af714a (patch)
treebe66f4beb9de1b2fecbf1e59950fe714184c8ecb /fs/orangefs/devorangefs-req.c
parenta21aae3bb15a1d08040bdcf5a73504c0da9f5080 (diff)
parent0c95ad76361f1d75a1ffdf82deafbcec44d19c42 (diff)
downloadlinux-f808e138c0abd99bfce90ec8d4ef6406c2af714a.tar.xz
Merge branch 'features' into for-next
Pull in an OrangeFS branch containing improvements which the userspace component and the kernel to negotiate mutually supported features.
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..ec1a5ff1d843 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 orangefs_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 (!orangefs_userspace_version) {
+ orangefs_userspace_version = head.version;
+ } else if (orangefs_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;
+ orangefs_userspace_version = 0;
mutex_unlock(&devreq_mutex);
return 0;
}