From 34957ff36b5b633e5d84a7eee09c440bc4a3c579 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 23 Jul 2010 15:14:43 -0700 Subject: [PATCH] mds: fix lease issue mask We define 1 to be the only lease "mask" we currently support (for dentry) and divorce ourselves from the CEPH_LOCK namespace for this purpose. We did this in c8d7c970e864e9f130b7c44b29c322771067026e, but screwed up the issue function. Fix the caller, and pay attention to @mask here. Signed-off-by: Sage Weil --- src/mds/Locker.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index da589af1ff606..8c7787fd459c9 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -2228,7 +2228,7 @@ void Locker::_issue_client_lease(CDentry *dn, int mask, int pool, client_t clien bufferlist &bl, utime_t now, Session *session) { LeaseStat e; - e.mask = 1; + e.mask = mask; if (mask) { ClientLease *l = dn->add_client_lease(client, mask, session); @@ -2243,7 +2243,8 @@ void Locker::_issue_client_lease(CDentry *dn, int mask, int pool, client_t clien e.duration_ms = (int)(1000 * mdcache->client_lease_durations[pool]); ::encode(e, bl); - dout(20) << "_issue_client_lease mask " << e.mask << " dur " << e.duration_ms << "ms" << dendl; + dout(20) << "_issue_client_lease mask " << e.mask << " seq " << e.seq << " dur " << e.duration_ms << "ms " + << " on " << *dn << dendl; } @@ -2279,7 +2280,7 @@ int Locker::issue_client_lease(CDentry *dn, client_t client, ((!diri->filelock.can_lease(client) && (diri->get_client_cap_pending(client) & (CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL)) == 0)) && dn->lock.can_lease(client)) - mask |= CEPH_LOCK_DN; + mask |= 1; // dentry lease. always 1. _issue_client_lease(dn, mask, pool, client, bl, now, session); return mask; -- 2.39.5