mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
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:
parent
413d5e6aa7
commit
6c6f75dae1
@ -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!
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user