From: majianpeng <majianpeng@gmail.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel <ceph-devel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
davem <davem@davemloft.net>
Subject: [PATCH] libceph: Call con->ops->put(con) if cancel_delayed_work(&con->work) worked.
Date: Mon, 24 Jun 2013 09:22:19 +0800 [thread overview]
Message-ID: <201306240921544358210@gmail.com> (raw)
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
WARNING: multiple messages have this Message-ID (diff)
From: majianpeng <majianpeng@gmail.com>
To: "Sage Weil" <sage@inktank.com>, davem <davem@davemloft.net>
Cc: ceph-devel <ceph-devel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
davem <davem@davemloft.net>
Subject: [PATCH] libceph: Call con->ops->put(con) if cancel_delayed_work(&con->work) worked.
Date: Mon, 24 Jun 2013 09:22:19 +0800 [thread overview]
Message-ID: <201306240921544358210@gmail.com> (raw)
[-- 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¥
next reply other threads:[~2013-06-24 1:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 1:22 majianpeng [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201306240921544358210@gmail.com \
--to=majianpeng@gmail.com \
--cc=ceph-devel@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.