diff mbox

[4/6] ceph: allocate cap_release message when receiving cap import

Message ID 1357299261-20591-5-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Jan. 4, 2013, 11:34 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

When client wants to release an imported cap, it's possible there
is no reserved cap_release message in corresponding mds session.
so __queue_cap_release causes kernel panic.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 fs/ceph/caps.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Sage Weil Jan. 6, 2013, 6:12 a.m. UTC | #1
Reviewed-by: Sage Weil <sage@inktank.com>

This is one of those annoying situations where we may not have 
preallocated the memory and in the message handler may not be able to.  
It should be easy to find when we come back to clean that up, though, 
since almost all ceph_add_cap_releases() are similarly affected.


On Fri, 4 Jan 2013, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 
> When client wants to release an imported cap, it's possible there
> is no reserved cap_release message in corresponding mds session.
> so __queue_cap_release causes kernel panic.
> 
> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
> ---
>  fs/ceph/caps.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
> index c90b245..7e90299 100644
> --- a/fs/ceph/caps.c
> +++ b/fs/ceph/caps.c
> @@ -2832,6 +2832,9 @@ void ceph_handle_caps(struct ceph_mds_session *session,
>  	dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq,
>  	     (unsigned)seq);
>  
> +	if (op == CEPH_CAP_OP_IMPORT)
> +		ceph_add_cap_releases(mdsc, session);
> +
>  	/* lookup ino */
>  	inode = ceph_find_inode(sb, vino);
>  	ci = ceph_inode(inode);
> -- 
> 1.7.11.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index c90b245..7e90299 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2832,6 +2832,9 @@  void ceph_handle_caps(struct ceph_mds_session *session,
 	dout(" mds%d seq %lld cap seq %u\n", session->s_mds, session->s_seq,
 	     (unsigned)seq);
 
+	if (op == CEPH_CAP_OP_IMPORT)
+		ceph_add_cap_releases(mdsc, session);
+
 	/* lookup ino */
 	inode = ceph_find_inode(sb, vino);
 	ci = ceph_inode(inode);