drbd: fix potential activity log refcount imbalance in error path
authorLars Ellenberg <lars.ellenberg@linbit.com>
Mon, 16 May 2011 13:31:45 +0000 (15:31 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 24 May 2011 08:06:44 +0000 (10:06 +0200)
It is no longer sufficient to trigger on local WRITE,
we need to check on (rq_state & RQ_IN_ACT_LOG)
before calling drbd_al_complete_io also in the error path.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_req.c

index 5c0c8be1bb0ae144e4d82ef9d3da257ca06af99d..14645bd4009234ab0ee8a5305a0d7aa202ebe7e1 100644 (file)
@@ -1033,7 +1033,7 @@ fail_conflicting:
        err = 0;
 
 fail_free_complete:
-       if (rw == WRITE && local)
+       if (req->rq_state & RQ_IN_ACT_LOG)
                drbd_al_complete_io(mdev, sector);
 fail_and_free_req:
        if (local) {