From: James Bottomley <James.Bottomley@SteelEye.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Jens Axboe <axboe@suse.de>, Christoph Hellwig <hch@infradead.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH scsi-misc-2.6 02/07] scsi: make scsi_send_eh_cmnd use its own timer instead of scmd->eh_timeout
Date: Mon, 18 Apr 2005 10:33:21 -0500 [thread overview]
Message-ID: <1113838401.4998.27.camel@mulgrave> (raw)
In-Reply-To: <20050410184214.B68C4CBA@htj.dyndns.org>
On Mon, 2005-04-11 at 03:45 +0900, Tejun Heo wrote:
> scmd->eh_timeout is used to resolve the race between command
> completion and timeout. However, during error handling,
> scsi_send_eh_cmnd uses scmd->eh_timeout. This creates a race
> condition between eh and normal completion for a request which
> has timed out and in the process of error handling. If the
> request completes while scmd->eh_timeout is being used by eh,
> eh timeout is lost and the command will be handled by both eh
> and completion path. This patch fixes the race by making
> scsi_send_eh_cmnd() use its own timer.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
The logic is wrong in there.
The problem is you cannot rely on the timer being pending as a signal
that the command completed normally. The kernel doesn't define the
elapsed time between the eh_action semaphore going up and the process
waiting for it being scheduled. If the timer fires within that
undefined interval, you'll think the command timed out when it, in fact,
completed normally.
James
next prev parent reply other threads:[~2005-04-18 15:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-10 18:45 [PATCH scsi-misc-2.6 00/07] scsi: timer updates Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 01/07] scsi: make aic7xxx use its own timer instead of scmd->eh_timeout Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 02/07] scsi: make scsi_send_eh_cmnd " Tejun Heo
2005-04-18 15:33 ` James Bottomley [this message]
2005-04-18 22:31 ` Tejun Heo
2005-04-18 22:55 ` James Bottomley
2005-04-18 23:25 ` Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 03/07] scsi: remove a timer race in scsi_queue_insert() Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 04/07] scsi: remove unnecessary scsi_delete_timer() call in scsi_reset_provider() Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 05/07] scsi: unexport scsi_{add|delete}_timer() Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 06/07] scsi: Delete scsi_{add|delete}_timer() from scsi_mid_low_api.txt Tejun Heo
2005-04-10 18:45 ` [PATCH scsi-misc-2.6 07/07] scsi: make reuse of SCSI cmd timer strict Tejun Heo
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=1113838401.4998.27.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=axboe@suse.de \
--cc=hch@infradead.org \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.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