libceph: don't try checking queue_work() return value
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 11 Sep 2014 08:18:53 +0000 (12:18 +0400)
committerIlya Dryomov <idryomov@redhat.com>
Tue, 14 Oct 2014 17:03:25 +0000 (21:03 +0400)
queue_work() doesn't "fail to queue", it returns false if work was
already on a queue, which can't happen here since we allocate
event_work right before we queue it.  So don't bother at all.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
net/ceph/osd_client.c

index 01aeddf284699f6aff4cde7e0f44b74941b56894..a528ea34253a404a32e2056b12ecbe798edcf6c1 100644 (file)
@@ -2358,24 +2358,19 @@ static void handle_watch_notify(struct ceph_osd_client *osdc,
        if (event) {
                event_work = kmalloc(sizeof(*event_work), GFP_NOIO);
                if (!event_work) {
-                       dout("ERROR: could not allocate event_work\n");
-                       goto done_err;
+                       pr_err("couldn't allocate event_work\n");
+                       ceph_osdc_put_event(event);
+                       return;
                }
                INIT_WORK(&event_work->work, do_event_work);
                event_work->event = event;
                event_work->ver = ver;
                event_work->notify_id = notify_id;
                event_work->opcode = opcode;
-               if (!queue_work(osdc->notify_wq, &event_work->work)) {
-                       dout("WARNING: failed to queue notify event work\n");
-                       goto done_err;
-               }
-       }
 
-       return;
+               queue_work(osdc->notify_wq, &event_work->work);
+       }
 
-done_err:
-       ceph_osdc_put_event(event);
        return;
 
 bad: