]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ceph: fix kick_requests()
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 30 Jul 2014 02:12:47 +0000 (10:12 +0800)
committerIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 7 Aug 2014 10:30:00 +0000 (14:30 +0400)
__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>
fs/ceph/mds_client.c

index fd8d7ca80e75955e09df2d37393e0c5d2e2ee4e0..bad07c09f91ead03419fe8e25fb1df18b4ac439e 100644 (file)
@@ -2067,11 +2067,12 @@ static void __wake_requests(struct ceph_mds_client *mdsc,
 static void kick_requests(struct ceph_mds_client *mdsc, int mds)
 {
        struct ceph_mds_request *req;
-       struct rb_node *p;
+       struct rb_node *p = rb_first(&mdsc->request_tree);
 
        dout("kick_requests mds%d\n", mds);
-       for (p = rb_first(&mdsc->request_tree); p; p = rb_next(p)) {
+       while (p) {
                req = rb_entry(p, struct ceph_mds_request, r_node);
+               p = rb_next(p);
                if (req->r_got_unsafe)
                        continue;
                if (req->r_session &&