summaryrefslogtreecommitdiffstats
path: root/src/mds/FileLock.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2008-06-06 01:19:23 +0200
committerSage Weil <sage@newdream.net>2008-06-06 01:19:23 +0200
commitcc0e252768153f70f051c8a7eec3c2327c6c1f6b (patch)
tree9e37700dc639b8e09301c9a325c202cbd04fe4e7 /src/mds/FileLock.h
parentmds: fix ScatterLock can_wrlock (diff)
downloadceph-cc0e252768153f70f051c8a7eec3c2327c6c1f6b.tar.xz
ceph-cc0e252768153f70f051c8a7eec3c2327c6c1f6b.zip
mds: fix FileLock can_wrlock
Diffstat (limited to 'src/mds/FileLock.h')
-rw-r--r--src/mds/FileLock.h9
1 files changed, 5 insertions, 4 deletions
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());