From f1f736387d645f856b0bb3cbad7426d55f80f316 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 15 Feb 2010 12:05:09 -0800 Subject: [PATCH] --- yaml --- r: 188711 b: refs/heads/master c: 91e45ce38946a8efa21fefbc65d023ca3c0b434f h: refs/heads/master i: 188709: 5cbc22c4022ed85c1cc45ea69a6f9db61c455eb0 188707: b4ab6d5836cff74fc5997386be9d0b295aa65c7a 188703: f730de543eb6f495826a08ead39287faf06cfb52 v: v3 --- [refs] | 2 +- trunk/fs/ceph/messenger.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9e6dd235a89f..82de7b3a75ec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e2663ab60de59d20fa33da3528f6d5359f8eb003 +refs/heads/master: 91e45ce38946a8efa21fefbc65d023ca3c0b434f diff --git a/trunk/fs/ceph/messenger.c b/trunk/fs/ceph/messenger.c index acf383f6a9cd..ca2ad0e5bb28 100644 --- a/trunk/fs/ceph/messenger.c +++ b/trunk/fs/ceph/messenger.c @@ -344,6 +344,7 @@ void ceph_con_close(struct ceph_connection *con) clear_bit(STANDBY, &con->state); /* avoid connect_seq bump */ mutex_lock(&con->mutex); reset_connection(con); + cancel_delayed_work(&con->work); mutex_unlock(&con->mutex); queue_con(con); } @@ -1841,6 +1842,8 @@ static void ceph_fault(struct ceph_connection *con) clear_bit(BUSY, &con->state); /* to avoid an improbable race */ mutex_lock(&con->mutex); + if (test_bit(CLOSED, &con->state)) + goto out_unlock; con_close_socket(con); @@ -1876,8 +1879,6 @@ static void ceph_fault(struct ceph_connection *con) else if (con->delay < MAX_DELAY_INTERVAL) con->delay *= 2; - mutex_unlock(&con->mutex); - /* explicitly schedule work to try to reconnect again later. */ dout("fault queueing %p delay %lu\n", con, con->delay); con->ops->get(con); @@ -1885,6 +1886,8 @@ static void ceph_fault(struct ceph_connection *con) round_jiffies_relative(con->delay)) == 0) con->ops->put(con); +out_unlock: + mutex_unlock(&con->mutex); out: if (con->ops->fault) con->ops->fault(con);