From cc0e252768153f70f051c8a7eec3c2327c6c1f6b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 5 Jun 2008 16:19:23 -0700 Subject: mds: fix FileLock can_wrlock --- src/mds/FileLock.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mds/FileLock.h') diff --git a/src/mds/FileLock.h b/src/mds/FileLock.h index 5454f5cddc1..82c29d294f8 100644 --- a/src/mds/FileLock.h +++ b/src/mds/FileLock.h @@ -164,10 +164,11 @@ class FileLock : public SimpleLock { // wrlock bool can_wrlock() { return - state == LOCK_LOCK || state == LOCK_GLOCKM || state == LOCK_GLOCKL || - state == LOCK_MIXED || state == LOCK_GMIXEDL || - state == LOCK_LONER || state == LOCK_GLONERM || - state == LOCK_GSYNCM || state == LOCK_GSYNCL; + parent->is_auth() && + (state == LOCK_LOCK || state == LOCK_GLOCKM || state == LOCK_GLOCKL || + state == LOCK_MIXED || state == LOCK_GMIXEDL || + state == LOCK_LONER || state == LOCK_GLONERM || + state == LOCK_GSYNCM || state == LOCK_GSYNCL); } void get_wrlock(bool force) { assert(force || can_wrlock()); -- cgit v1.2.3