ceph: protect kick_requests() with mdsc->mutex
PATCH 1/2 ceph: protect kick_requests() with mdsc->mutex
From: "Yan, Zheng" <[email protected]>
Signed-off-by Yan, Zheng <[email protected]>
--- fs/ceph/mds_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ceph/mds_client.c +3 -2
@@ -2471,9 +2471,8 @@ static void handle_session(struct ceph_mds_session *session,if (session->s_state ==CEPH_MDS_SESSION_RECONNECTING )pr_info ("mds%d reconnect denied\n" , session->s_mds);remove_session_caps (session); - wake =1 ;/* for good measure */ + wake =2 ;/* for good measure */ wake_up_all (&mdsc->session_close_wq); -kick_requests (mdsc, mds);break ;case CEPH_SESSION_STALE :
@@ -2503,6 +2502,8 @@ static void handle_session(struct ceph_mds_session *session,if (wake) {mutex_lock (&mdsc->mutex);__wake_requests (mdsc, &session->s_waiting); +if (wake ==2 ) +kick_requests (mdsc, mds);mutex_unlock (&mdsc->mutex); }return ;
Signature · 1 line
1.9.3
PATCH 2/2 ceph: make sure request isn't in any waiting list when kicking request.
From: "Yan, Zheng" <[email protected]>
we may corrupt waiting list if a request in the waiting list is kicked.
Signed-off-by Yan, Zheng <[email protected]>
--- fs/ceph/mds_client.c | 1 + 1 file changed, 1 insertion(+)
fs/ceph/mds_client.c +1 -0
@@ -2078,6 +2078,7 @@ static void kick_requests(struct ceph_mds_client *mdsc, int mds)if (req->r_session && req->r_session->s_mds == mds) {dout (" kicking tid %llu\n" , req->r_tid); +list_del_init (&req->r_wait);__do_request (mdsc, req); } }
Signature · 1 line
1.9.3
Re: [PATCH 2/2] ceph: make sure request isn't in any waiting list when kicking request.
Reviewed-by Sage Weil <[email protected]>
Quoted 30 lines · Zheng
From: "Yan, Zheng" <[email protected]>
we may corrupt waiting list if a request in the waiting list is kicked.
Signed-off-by Yan, Zheng <[email protected]>--- fs/ceph/mds_client.c | 1 + 1 file changed, 1 insertion(+)fs/ceph/mds_client.c +1
-0@@ -2078,6 +2078,7 @@ static void kick_requests(struct ceph_mds_client *mdsc, int mds)if (req->r_session && req->r_session->s_mds == mds) {dout (" kicking tid %llu\n" , req->r_tid); +list_del_init (&req->r_wait);__do_request (mdsc, req); } }Signature · 6 lines
1.9.3 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Reviewed-by Sage Weil <[email protected]>
Quoted 40 lines · Zheng
From: "Yan, Zheng" <[email protected]>
Signed-off-by Yan, Zheng <[email protected]>--- fs/ceph/mds_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)fs/ceph/mds_client.c +3
-2@@ -2471,9 +2471,8 @@ static void handle_session(struct ceph_mds_session *session,if (session->s_state ==CEPH_MDS_SESSION_RECONNECTING )pr_info ("mds%d reconnect denied\n" , session->s_mds);remove_session_caps (session); - wake =1 ;/* for good measure */ + wake =2 ;/* for good measure */ wake_up_all (&mdsc->session_close_wq); -kick_requests (mdsc, mds);break ;case CEPH_SESSION_STALE :@@ -2503,6 +2502,8 @@ static void handle_session(struct ceph_mds_session *session,if (wake) {mutex_lock (&mdsc->mutex);__wake_requests (mdsc, &session->s_waiting); +if (wake ==2 ) +kick_requests (mdsc, mds);mutex_unlock (&mdsc->mutex); }return ;Signature · 6 lines
1.9.3 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html