diff options
-rw-r--r-- | src/client/Client.cc | 16 | ||||
-rw-r--r-- | src/client/Inode.h | 2 | ||||
-rw-r--r-- | src/client/MetaRequest.h | 4 |
3 files changed, 15 insertions, 7 deletions
diff --git a/src/client/Client.cc b/src/client/Client.cc index 65134978919..c5dbb23cf82 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -2176,7 +2176,11 @@ void Client::handle_client_reply(MClientReply *reply) if (is_dir_operation(request)) { Inode *dir = request->inode(); assert(dir); - dir->unsafe_dir_ops.push_back(&request->unsafe_dir_item); + dir->unsafe_ops.push_back(&request->unsafe_dir_item); + } + if (request->target) { + InodeRef &in = request->target; + in->unsafe_ops.push_back(&request->unsafe_target_item); } } @@ -2203,6 +2207,7 @@ void Client::handle_client_reply(MClientReply *reply) if (request->got_unsafe) { request->unsafe_item.remove_myself(); request->unsafe_dir_item.remove_myself(); + request->unsafe_target_item.remove_myself(); signal_cond_list(request->waitfor_safe); } request->item.remove_myself(); @@ -2582,6 +2587,7 @@ void Client::kick_requests_closed(MetaSession *session) lderr(cct) << "kick_requests_closed removing unsafe request " << req->get_tid() << dendl; req->unsafe_item.remove_myself(); req->unsafe_dir_item.remove_myself(); + req->unsafe_target_item.remove_myself(); signal_cond_list(req->waitfor_safe); unregister_request(req); } @@ -8102,8 +8108,8 @@ int Client::_fsync(Inode *in, bool syncdataonly) } } - if (!in->unsafe_dir_ops.empty()) { - MetaRequest *req = in->unsafe_dir_ops.back(); + if (!in->unsafe_ops.empty()) { + MetaRequest *req = in->unsafe_ops.back(); uint64_t last_tid = req->get_tid(); ldout(cct, 15) << "waiting on unsafe requests, last tid " << last_tid << dendl; @@ -8111,9 +8117,9 @@ int Client::_fsync(Inode *in, bool syncdataonly) req->get(); wait_on_list(req->waitfor_safe); put_request(req); - if (in->unsafe_dir_ops.empty()) + if (in->unsafe_ops.empty()) break; - req = in->unsafe_dir_ops.front(); + req = in->unsafe_ops.front(); } while (req->tid < last_tid); } diff --git a/src/client/Inode.h b/src/client/Inode.h index a13fd98bc7b..7b7daa1ec69 100644 --- a/src/client/Inode.h +++ b/src/client/Inode.h @@ -295,7 +295,7 @@ struct Inode { ceph_lock_state_t *fcntl_locks; ceph_lock_state_t *flock_locks; - xlist<MetaRequest*> unsafe_dir_ops; + xlist<MetaRequest*> unsafe_ops; Inode(Client *c, vinodeno_t vino, ceph_file_layout *newlayout) : client(c), ino(vino.ino), snapid(vino.snapid), faked_ino(0), diff --git a/src/client/MetaRequest.h b/src/client/MetaRequest.h index 660a88a9ac9..7ace1dc65cf 100644 --- a/src/client/MetaRequest.h +++ b/src/client/MetaRequest.h @@ -72,6 +72,7 @@ public: xlist<MetaRequest*>::item item; xlist<MetaRequest*>::item unsafe_item; xlist<MetaRequest*>::item unsafe_dir_item; + xlist<MetaRequest*>::item unsafe_target_item; Mutex lock; //for get/set sync Cond *caller_cond; // who to take up @@ -94,7 +95,8 @@ public: ref(1), reply(0), kick(false), aborted(false), success(false), readdir_offset(0), readdir_end(false), readdir_num(0), - got_unsafe(false), item(this), unsafe_item(this), unsafe_dir_item(this), + got_unsafe(false), item(this), unsafe_item(this), + unsafe_dir_item(this), unsafe_target_item(this), lock("MetaRequest lock"), caller_cond(0), dispatch_cond(0) { memset(&head, 0, sizeof(ceph_mds_request_head)); |