]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: prevent filelock from being stuck at XSYN state 18787/head
authorYan, Zheng <zyan@redhat.com>
Tue, 7 Nov 2017 04:39:49 +0000 (12:39 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 7 Nov 2017 08:46:25 +0000 (16:46 +0800)
Lock:file_eval() does not properly handle the condition: filelock
is in XSYN state, both loner_cap and want_loner_cap are >= 0, and
loner_cap != want_loner_cap.

To set loner to the wanted one, mds need to revoke caps from the old
loner. Changing lock state to MIX can do the job.

Fixes: http://tracker.ceph.com/issues/22008
Signed-off-by: "Yan, Zheng" <zyan@redhat.com
src/mds/Locker.cc

index 103b48ea87a010e06de13f6cbcf869236239b238..bfa4c28dd03bd4d3d05b176ad9f0f6e72fe98898 100644 (file)
@@ -4850,7 +4850,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue)
           !lock->is_rdlocked() &&
           //!lock->is_waiter_for(SimpleLock::WAIT_WR) &&
           (lock->get_scatter_wanted() ||
-           (in->get_wanted_loner() < 0 && (wanted & CEPH_CAP_GWR)))) {
+           (in->get_target_loner() < 0 && (wanted & CEPH_CAP_GWR)))) {
     dout(7) << "file_eval stable, bump to mixed " << *lock
            << " on " << *lock->get_parent() << dendl;
     scatter_mix(lock, need_issue);