fixed memory leak in path_traverse

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1911 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
sageweil 2007-10-10 18:12:38 +00:00
parent 3a12ce6c29
commit afc69b119e
2 changed files with 10 additions and 4 deletions

View File

@ -1109,7 +1109,7 @@ bool Locker::simple_rdlock_try(SimpleLock *lock, Context *con)
// wait!
dout(7) << "simple_rdlock_try waiting on " << *lock << " on " << *lock->get_parent() << dendl;
lock->add_waiter(SimpleLock::WAIT_RD, con);
if (con) lock->add_waiter(SimpleLock::WAIT_RD, con);
return false;
}

View File

@ -3754,10 +3754,13 @@ void MDCache::dispatch(Message *m)
Context *MDCache::_get_waiter(MDRequest *mdr, Message *req)
{
if (mdr)
if (mdr) {
dout(20) << "_get_waiter retryrequest" << dendl;
return new C_MDS_RetryRequest(this, mdr);
else
} else {
dout(20) << "_get_waiter retrymessage" << dendl;
return new C_MDS_RetryMessage(mds, req);
}
}
int MDCache::path_traverse(MDRequest *mdr, Message *req, // who
@ -3840,8 +3843,11 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, // who
// must read directory hard data (permissions, x bit) to traverse
if (!noperm &&
!mds->locker->simple_rdlock_try(&cur->authlock, _get_waiter(mdr, req)))
!mds->locker->simple_rdlock_try(&cur->authlock, 0)) {
dout(7) << "traverse: waiting on authlock rdlock on " << *cur << dendl;
cur->authlock.add_waiter(SimpleLock::WAIT_RD, _get_waiter(mdr, req));
return 1;
}
// check permissions?
// XXX