]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: prevent filelock from being stuck at XSYN state 20340/head
authorYan, Zheng <zyan@redhat.com>
Tue, 7 Nov 2017 04:39:49 +0000 (12:39 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 6 Feb 2018 17:44:35 +0000 (09:44 -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
(cherry picked from commit 67a428741fc82eb5f4120042197acf0cec34213a)

src/mds/Locker.cc

index 4a2cc24288593c2c5e214999e0cea35424702754..fdbf2b5c89cb406b7a79ef68d2e031118ca695f6 100644 (file)
@@ -4835,7 +4835,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);