drbd: Fix completion of requests while the device is suspended
authorPhilipp Reisner <philipp.reisner@linbit.com>
Tue, 14 Aug 2012 09:28:52 +0000 (11:28 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 9 Nov 2012 13:05:50 +0000 (14:05 +0100)
commit5af2e8ce2b463c2cc8e4a074f9d8f660ae7c1d8f
tree17e450ce313e0fa63096c61acf57536f4e40f533
parent715306f69d85f7ea21eaef4efe75b8364cfea1d5
drbd: Fix completion of requests while the device is suspended

In various places (E.g. CONNECTION_LOST_WHILE_PENDING) the
RQ_COMPLETION_SUSP mask is passed in the clear set to mod_rq_state().

The issue was that it tried to clear the RQ_COMPLETION_SUSP bit
out of the state mask first, and eventuelly set it afterwards,
in the drbd_req_put_completion_ref() function.

Fixed that by moving the reference getting out of
drbd_req_put_completion_ref() into the mod_rq_state(), before the place
where the extra reference might be put.

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