public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libceph: Call con->ops->put(con) if cancel_delayed_work(&con->work) worked.
@ 2013-06-24  1:22 majianpeng
  2013-06-24  3:30 ` Sage Weil
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-06-24  1:22 UTC (permalink / raw)
  To: Sage Weil, davem; +Cc: ceph-devel, linux-kernel, davem

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 929 bytes --]

Because in func queue_con_delay, it will call con->ops->get(con).
So if we cancel the work successfully,we must call con->ops->put(con).
Otherwise some resource can't free like 'struct ceph_mds_session'.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 net/ceph/messenger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index eb0a46a..8207b37 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -661,7 +661,8 @@ void ceph_con_close(struct ceph_connection *con)
 
 	reset_connection(con);
 	con->peer_global_seq = 0;
-	cancel_delayed_work(&con->work);
+	if (cancel_delayed_work(&con->work))
+		con->ops->put(con);
 	con_close_socket(con);
 	mutex_unlock(&con->mutex);
 }
-- 
1.8.1.2
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2013-06-24  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-24  1:22 [PATCH] libceph: Call con->ops->put(con) if cancel_delayed_work(&con->work) worked majianpeng
2013-06-24  3:30 ` Sage Weil

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