mds: avoid EXCL if mds_caps_wanted in _do_cap_update

The file_excl() trigger asserts mds_caps_wanted is empty.  The caller
shouldn't call it if that's the case.  If it is, just go to LOCK instead.
All we're doing is picking a state to move to that will allow us to
update max_size.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2010-10-11 21:25:17 -07:00
parent fa2c371f6e
commit fc609846d4

View File

@ -2343,7 +2343,8 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
if (in->filelock.is_stable()) {
bool need_issue = false;
cap->inc_suppress();
if (in->get_loner() >= 0 || (in->get_wanted_loner() >= 0 && in->try_set_loner())) {
if (in->mds_caps_wanted.empty() &&
(in->get_loner() >= 0 || (in->get_wanted_loner() >= 0 && in->try_set_loner()))) {
if (in->filelock.get_state() != LOCK_EXCL)
file_excl(&in->filelock, &need_issue);
need_issue = false; // loner!