From bb9a9ca1d2bf8efeece94b8d4537b6c9ebc9cf16 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 28 Mar 2008 12:34:25 -0700 Subject: [PATCH] client: behave if we get a file_caps message and want caps, but don't have a cap yet --- src/client/Client.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index df6df26c3b29b..9529798bc3991 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1359,8 +1359,11 @@ void Client::handle_file_caps(MClientFileCaps *m) } // don't want? + // or, don't have cap? + // (it may be that we've reopened the file locally, + // and thus want caps, but don't have a cap yet) int wanted = in->file_caps_wanted(); - if (wanted == 0) { + if (wanted == 0 || in->caps.count(mds) == 0) { dout(5) << "handle_file_caps on ino " << m->get_ino() << " seq " << m->get_seq() << " " << cap_string(m->get_caps()) @@ -1372,8 +1375,6 @@ void Client::handle_file_caps(MClientFileCaps *m) return; } - assert(in->caps.count(mds)); - // update per-mds caps const int old_caps = in->caps[mds].caps; const int new_caps = m->get_caps(); -- 2.39.5