From: Sam Lang Date: Mon, 1 Apr 2013 14:06:59 +0000 (-0500) Subject: client: Kick waiters for max size X-Git-Tag: v0.62~89^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ce09fad559700de3975e7152adb948ecff23303;p=ceph.git client: Kick waiters for max size If the mds restarts without successfully logging a max size cap update, the client waits indefinitely in Client::get_caps on the waitfor_caps list. So when the client gets an mds map indicating a new active mds has replaced a down mds, we need to kick the caps update request. This patch mimics the behavior in the kernel by setting the wanted_max_size and requested_max_size to 0 and wakes up the waiters. Fixes #4582. Signed-off-by: Sam Lang --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 447d44d618fb..420c3ad00f29 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1890,6 +1890,8 @@ void Client::handle_mds_map(MMDSMap* m) kick_requests(p->second, false); kick_flushing_caps(p->second); signal_cond_list(p->second->waiting_for_open); + kick_maxsize_requests(p->second); + wake_inode_waiters(p->second); } connect_mds_targets(p->first); } @@ -3031,6 +3033,17 @@ void Client::kick_flushing_caps(MetaSession *session) } } +void Client::kick_maxsize_requests(MetaSession *session) +{ + xlist::iterator iter = session->caps.begin(); + while (!iter.end()){ + (*iter)->inode->requested_max_size = 0; + (*iter)->inode->wanted_max_size = 0; + signal_cond_list((*iter)->inode->waitfor_caps); + ++iter; + } +} + void SnapRealm::build_snap_context() { set snaps; diff --git a/src/client/Client.h b/src/client/Client.h index 03764aee240e..29a5020c6a63 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -426,6 +426,7 @@ protected: void flush_caps(); void flush_caps(Inode *in, MetaSession *session); void kick_flushing_caps(MetaSession *session); + void kick_maxsize_requests(MetaSession *session); int get_caps(Inode *in, int need, int want, int *have, loff_t endoff); void maybe_update_snaprealm(SnapRealm *realm, snapid_t snap_created, snapid_t snap_highwater,