Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: fix kick_requests()

__do_request() may unregister the request. So we should update
iterator 'p' before calling __do_request()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>

authored by

Yan, Zheng and committed by
Ilya Dryomov
282c1052 06fee30f

+3 -2
+3 -2
fs/ceph/mds_client.c
··· 2067 2067 static void kick_requests(struct ceph_mds_client *mdsc, int mds) 2068 2068 { 2069 2069 struct ceph_mds_request *req; 2070 - struct rb_node *p; 2070 + struct rb_node *p = rb_first(&mdsc->request_tree); 2071 2071 2072 2072 dout("kick_requests mds%d\n", mds); 2073 - for (p = rb_first(&mdsc->request_tree); p; p = rb_next(p)) { 2073 + while (p) { 2074 2074 req = rb_entry(p, struct ceph_mds_request, r_node); 2075 + p = rb_next(p); 2075 2076 if (req->r_got_unsafe) 2076 2077 continue; 2077 2078 if (req->r_session &&