From 996c8bf0f8ddb024f0d8dfeadb9012a62ef52274 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 12 Nov 2008 14:18:04 -0800 Subject: [PATCH] Revert "client: adjust objecter locking" This reverts commit 1c70b1d8f62ad8d9eeef3a86ef36d8e6933c5702. Actually, we need client_lock to protect access ot the objecter and cache structures, as they have no internal locking. Fix the safecond separately... --- src/client/Client.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 5f126406783f5..2f14d490fd3b4 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1096,15 +1096,11 @@ void Client::dispatch(Message *m) // osd case CEPH_MSG_OSD_OPREPLY: - client_lock.Unlock(); objecter->handle_osd_op_reply((MOSDOpReply*)m); - client_lock.Lock(); break; case CEPH_MSG_OSD_MAP: - client_lock.Unlock(); objecter->handle_osd_map((class MOSDMap*)m); - client_lock.Lock(); if (!mounted) mount_cond.Signal(); break; @@ -1669,7 +1665,8 @@ void Client::_flush(Inode *in, Context *onfinish) void Client::flush_set_callback(inodeno_t ino) { - Mutex::Locker l(client_lock); + // Mutex::Locker l(client_lock); + assert(client_lock.is_locked()); // will be called via dispatch() -> objecter -> ... Inode *in = inode_map[vinodeno_t(ino,CEPH_NOSNAP)]; assert(in); _flushed(in); @@ -3755,8 +3752,7 @@ public: void Client::sync_write_commit(Inode *in) { - Mutex::Locker l(client_lock); - + client_lock.Lock(); assert(unsafe_sync_write > 0); unsafe_sync_write--; @@ -3769,6 +3765,8 @@ void Client::sync_write_commit(Inode *in) } put_inode(in); + + client_lock.Unlock(); } int Client::write(int fd, const char *buf, loff_t size, loff_t offset) -- 2.47.3