Skip to content

Commit

Permalink
orangefs: record userspace version for feature compatbility
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Brandenburg committed Aug 9, 2016
1 parent a21aae3 commit f2ee3b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fs/orangefs/devorangefs-req.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() \
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions fs/orangefs/orangefs-kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ ssize_t orangefs_inode_read(struct inode *inode,
/*
* defined in devorangefs-req.c
*/
extern uint32_t userspace_version;

int orangefs_dev_init(void);
void orangefs_dev_cleanup(void);
int is_daemon_in_service(void);
Expand Down

0 comments on commit f2ee3b7

Please sign in to comment.