summaryrefslogtreecommitdiffstats
path: root/fs/orangefs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-22 19:46:08 -0500
committerMike Marshall <hubcap@omnibond.com>2016-01-23 12:55:24 -0500
commitfee25ce12504ff071254fd213055c3f1d3004622 (patch)
tree12f6d761dcefdf8fad5650748ec6a778cc525460 /fs/orangefs
parent96acf9d65e70e0eb2716e3e46c45f4acb8256f1a (diff)
downloadtalos-op-linux-fee25ce12504ff071254fd213055c3f1d3004622.tar.gz
talos-op-linux-fee25ce12504ff071254fd213055c3f1d3004622.zip
orangefs: make sure that reopening pvfs2-req won't overlap with the end of close
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs')
-rw-r--r--fs/orangefs/devorangefs-req.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index dadeb381f9fc..92573d9cc17c 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -85,7 +85,7 @@ static int orangefs_devreq_open(struct inode *inode, struct file *file)
mutex_lock(&devreq_mutex);
if (open_access_count == 0) {
- open_access_count++;
+ open_access_count = 1;
ret = 0;
} else {
DUMP_DEVICE_ERROR();
@@ -533,12 +533,11 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
if (orangefs_get_bufmap_init())
orangefs_bufmap_finalize();
- open_access_count--;
+ open_access_count = -1;
unmounted = mark_all_pending_mounts();
gossip_debug(GOSSIP_DEV_DEBUG, "ORANGEFS Device Close: Filesystem(s) %s\n",
(unmounted ? "UNMOUNTED" : "MOUNTED"));
- mutex_unlock(&devreq_mutex);
/*
* Walk through the list of ops in the request list, mark them
@@ -552,6 +551,8 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
purge_inprogress_ops();
gossip_debug(GOSSIP_DEV_DEBUG,
"pvfs2-client-core: device close complete\n");
+ open_access_count = 0;
+ mutex_unlock(&devreq_mutex);
return 0;
}
OpenPOWER on IntegriCloud