mds: check against client in rdlock_try

This affects our auth check in path_traverse.  No need to wait for that to
flush.. we can look at the projected version.  (Not that we're actually
checking permissions yet!)
This commit is contained in:
Sage Weil 2009-01-17 18:07:34 -08:00
parent 413d5e6aa7
commit 6c6f75dae1
3 changed files with 5 additions and 4 deletions

View File

@ -534,12 +534,13 @@ void Locker::eval(SimpleLock *lock)
// ------------------
// rdlock
bool Locker::rdlock_try(SimpleLock *lock, Context *con)
bool Locker::rdlock_try(SimpleLock *lock, int client, Context *con)
{
dout(7) << "rdlock_try on " << *lock << " on " << *lock->get_parent() << dendl;
// can read? grab ref.
if (lock->can_rdlock(-1))
#warning fixme
if (lock->can_rdlock(client))
return true;
// wait!

View File

@ -88,7 +88,7 @@ public:
void eval_cap_gather(CInode *in);
void eval(SimpleLock *lock);
bool rdlock_try(SimpleLock *lock, Context *c);
bool rdlock_try(SimpleLock *lock, int client, Context *c);
bool rdlock_start(SimpleLock *lock, MDRequest *mut);
void rdlock_finish(SimpleLock *lock, Mutation *mut);

View File

@ -5297,7 +5297,7 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, // who
// must read directory hard data (permissions, x bit) to traverse
if (!noperm &&
!mds->locker->rdlock_try(&cur->authlock, 0)) {
!mds->locker->rdlock_try(&cur->authlock, client, 0)) {
dout(7) << "traverse: waiting on authlock rdlock on " << *cur << dendl;
cur->authlock.add_waiter(SimpleLock::WAIT_RD, _get_waiter(mdr, req));
return 1;