From: Yan, Zheng Date: Fri, 4 Jan 2013 06:45:18 +0000 (+0800) Subject: ceph: allocate cap_release message when receiving cap import X-Git-Tag: v3.12-rc1~1044^2~24^2~59^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66f58691c5c820283dd7e4d6fe8649033ed43ceb;p=kernel%2Fkernel-generic.git ceph: allocate cap_release message when receiving cap import 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 Reviewed-by: Sage Weil --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 76b1923..40b5bbe 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -2833,6 +2833,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);