lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 Jun 2012 14:24:35 -0700
From:	Muthu Kumar <muthu.lkml@...il.com>
To:	Jens Axboe <axboe@...nel.dk>, tj@...nel.org,
	James.Bottomley@...senpartnership.com
Cc:	linux-kernel@...r.kernel.org
Subject: RFC:blk-exec-call-completion-if-queue-dead [was Q:
 blk_execute_rq_nowait() doesn't call completion in case of dead queue

How about this change?

diff --git a/block/blk-exec.c b/block/blk-exec.c
index fb2cbd5..6bf5c0b 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -56,8 +56,10 @@ void blk_execute_rq_nowait(struct request_queue *q, struct ge
        if (unlikely(blk_queue_dead(q))) {
                spin_unlock_irq(q->queue_lock);
                rq->errors = -ENXIO;
-               if (rq->end_io)
-                       rq->end_io(rq, rq->errors);
+                if (done)
+                    done(rq, rq->errors);
+                else if (rq->end_io)    //XXX Not sure if this check and end_io
+                    rq->end_io(rq, rq->errors);
                return;
        }

Only one driver - sx8.c, doesn't set done() function and every one
else expects done() to be called with error.

Regards,
Muthu


On Wed, Jun 6, 2012 at 11:59 AM, Muthu Kumar <muthu.lkml@...il.com> wrote:
> Jens, Tejun et al,
> blk_execute_rq() calls blk_execute_rq_nowait() with blk_end_sync_rq()
> as the completion (done) routine. And then waits for the completion().
>
>
>        rq->end_io_data = &wait;
>        blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
>        ...
>        ...
>        wait_for_completion(&wait)
>
> But in blk_execute_rq_nowait() if the queue is dead, completion
> routine is not called. Shouldn't we have to call the above completion
> (done()) to wake up the wait_for_completion()?
>
>
>        if (unlikely(blk_queue_dead(q))) {
>                spin_unlock_irq(q->queue_lock);
>                rq->errors = -ENXIO;
>                if (rq->end_io)
>                        rq->end_io(rq, rq->errors);
>                return;
>       }
>
> Thanks.
>
> Regards,
> Muthu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ