CEPH filesystem development
 help / color / mirror / Atom feed
* [PATCH v2] libceph: wait for con->work to finish when cancelling con
@ 2022-03-08 13:23 xiubli
  2022-03-08 13:37 ` Jeff Layton
  0 siblings, 1 reply; 7+ messages in thread
From: xiubli @ 2022-03-08 13:23 UTC (permalink / raw)
  To: jlayton, idryomov; +Cc: vshankar, ceph-devel, Xiubo Li

From: Xiubo Li <xiubli@redhat.com>

When reconnecting MDS it will reopen the con with new ip address,
but the when opening the con with new address it couldn't be sure
that the stale work has finished. So it's possible that the stale
work queued will use the new data.

This will use cancel_delayed_work_sync() instead.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---

V2:
- Call cancel_con() after dropping the mutex


 net/ceph/messenger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index d3bb656308b4..62e39f63f94c 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -581,8 +581,8 @@ void ceph_con_close(struct ceph_connection *con)
 
 	ceph_con_reset_protocol(con);
 	ceph_con_reset_session(con);
-	cancel_con(con);
 	mutex_unlock(&con->mutex);
+	cancel_con(con);
 }
 EXPORT_SYMBOL(ceph_con_close);
 
@@ -1416,7 +1416,7 @@ static void queue_con(struct ceph_connection *con)
 
 static void cancel_con(struct ceph_connection *con)
 {
-	if (cancel_delayed_work(&con->work)) {
+	if (cancel_delayed_work_sync(&con->work)) {
 		dout("%s %p\n", __func__, con);
 		con->ops->put(con);
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-09  9:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 13:23 [PATCH v2] libceph: wait for con->work to finish when cancelling con xiubli
2022-03-08 13:37 ` Jeff Layton
2022-03-08 14:24   ` Xiubo Li
2022-03-08 15:36     ` Ilya Dryomov
2022-03-09  1:46       ` Xiubo Li
2022-03-09  9:44         ` Ilya Dryomov
2022-03-09  9:58           ` Xiubo Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox