diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-23 01:47:47 +0100 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2016-01-23 19:03:12 +0100 |
commit | ed42fe059389daa35a2aa10ec832e9f8d0a9e59e (patch) | |
tree | 778e6ebb516e7a6301305b077e31ee40d9fe96c2 /fs/orangefs/orangefs-utils.c | |
parent | orangefs: make sure that reopening pvfs2-req won't overlap with the end of close (diff) | |
download | linux-ed42fe059389daa35a2aa10ec832e9f8d0a9e59e.tar.xz linux-ed42fe059389daa35a2aa10ec832e9f8d0a9e59e.zip |
orangefs: hopefully saner op refcounting and locking
* create with refcount 1
* make op_release() decrement and free if zero (i.e. old put_op()
has become that).
* mark when submitter has given up waiting; from that point nobody
else can move between the lists, change state, etc.
* have daemon read/write_iter grab a reference when picking op
and *always* give it up in the end
* don't put into hash until we know it's been successfully passed to
daemon
* move op->lock _lower_ than htab_in_progress_lock (and make sure
to take it in purge_inprogress_ops())
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/orangefs-utils.c')
-rw-r--r-- | fs/orangefs/orangefs-utils.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index f21233201ce3..a6117787ee8d 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -429,19 +429,15 @@ int orangefs_inode_setattr(struct inode *inode, struct iattr *iattr) ret = copy_attributes_from_inode(inode, &new_op->upcall.req.setattr.attributes, iattr); - if (ret < 0) { - op_release(new_op); - return ret; - } - - ret = service_operation(new_op, __func__, + if (ret >= 0) { + ret = service_operation(new_op, __func__, get_interruptible_flag(inode)); - gossip_debug(GOSSIP_UTILS_DEBUG, - "orangefs_inode_setattr: returning %d\n", - ret); + gossip_debug(GOSSIP_UTILS_DEBUG, + "orangefs_inode_setattr: returning %d\n", + ret); + } - /* when request is serviced properly, free req op struct */ op_release(new_op); /* |