public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Min Zhang <mzhang@mvista.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Tejun Heo <tj@kernel.org>,
	James Bottomley <James.Bottomley@suse.de>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: timeout reset timer before command is queued
Date: Tue, 15 Dec 2009 12:53:42 -0800	[thread overview]
Message-ID: <4B27F756.3040206@mvista.com> (raw)
In-Reply-To: <4B278C30.9020209@panasas.com>

Boaz Harrosh wrote:
>> Also timeout failure can still occur after scsi_request_fn unlock the 
>> host_lock and before scsi_dispatch_cmd re-lock it.
>>
>>     
>
> This was exactly my intention, to do all the things that can fail and the unlocking
> then relocking before we start the request. And leave no failing possibility and lock
> released between the start of the request and the dispatching. I think it would be wroth it.
>
> But it's your call
>
> Boaz
>   
How do you leave no failing possibility? As long as there is unlock and 
then relocking, it is unsafe since timeout could occur right between. 
Unless you meant hold the lock entirely but your patch didn't show.

e.g. the following scsi_request_fn() cmd could be a corrupt point 
already. I thought about removing this unlock call, but 
scsi_dispatch_cmd has this sleep call  need to hack around. 

        /*
         * XXX(hch): This is rather suboptimal, scsi_dispatch_cmd will
         *        take the lock again.
         */
        spin_unlock_irq(shost->host_lock);
        scsi_init_cmd_errh(cmd);

My other wish is to delay the start of timer until command is queued, 
but that has to change upper layer blk_start_request and might change 
entire block layer algorithm, too much impact on the other driver that 
use it.


      reply	other threads:[~2009-12-15 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-11  2:41 [PATCH] scsi: timeout reset timer before command is queued Min Zhang
2009-12-13  9:52 ` Boaz Harrosh
2009-12-15  1:17   ` Min Zhang
2009-12-15  2:21     ` Matthew Wilcox
2009-12-15  2:40       ` Min Zhang
2009-12-15  2:59         ` Matthew Wilcox
2009-12-15 10:40         ` Matthew Wilcox
2009-12-15 13:16     ` Boaz Harrosh
2009-12-15 20:53       ` Min Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B27F756.3040206@mvista.com \
    --to=mzhang@mvista.com \
    --cc=James.Bottomley@suse.de \
    --cc=bharrosh@panasas.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox