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 <[email protected]>
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]