block: add cond_resched() to potentially long running ioctl discard loop
[linux-3.10.git] / block / blk-timeout.c
index 6e4744c..5a6296e 100644 (file)
@@ -90,8 +90,8 @@ static void blk_rq_timed_out(struct request *req)
                __blk_complete_request(req);
                break;
        case BLK_EH_RESET_TIMER:
-               blk_clear_rq_complete(req);
                blk_add_timer(req);
+               blk_clear_rq_complete(req);
                break;
        case BLK_EH_NOT_HANDLED:
                /*
@@ -173,7 +173,6 @@ void blk_add_timer(struct request *req)
                return;
 
        BUG_ON(!list_empty(&req->timeout_list));
-       BUG_ON(test_bit(REQ_ATOM_COMPLETE, &req->atomic_flags));
 
        /*
         * Some LLDs, like scsi, peek at the timeout to prevent a