[2017] in linux-scsi channel archive
Re: Scsi removable disk patch
daemon@ATHENA.MIT.EDU (Richard Waltham)
Mon Jun 16 03:39:20 1997
From: Richard Waltham <dormouse@farsrobt.demon.co.uk>
To: lnz@dandelion.com (Leonard N. Zubkoff)
Date: Mon, 16 Jun 1997 08:06:09 +0100 (BST)
Cc: linux-scsi@vger.rutgers.edu
In-Reply-To: <199706152048.NAA28195@dandelion.com> from "Leonard N. Zubkoff" at Jun 15, 97 01:48:18 pm
Leonard N. Zubkoff wrote:
>
> From: Richard Waltham <dormouse@farsrobt.demon.co.uk>
> Date: Sat, 14 Jun 1997 12:56:34 +0100 (BST)
>
> The behaviour of the scsi code with removable drives that automatically
> spindown has been getting to me so I set out to fix it.
> .
> .
> .
> Patch is against 2.0.29 but also applies to 2.1.42 OK. Would be a useful
> addition to 2.0.31:)
>
> Excellent idea!
>
> Leonard
>
Thank you. You just made my day:)
However there is an occasional timeout with my original patch, failing about
1 in 47 spin ups, using the following script running for about 10 hours.
while (true) do { /sbin/e2fsck /dev/sdb3 ; jazsleep 1 /dev/sdb ; /usr/bin/sleep 75; } done
e2fsck /dev/sdb3 spins up the drive but does nothing as the file system is
clean. jazsleep is a little utility I wrote to set the spin down time for
the jaz drive. Runs here in case there is a timeout as any reset puts the
spin down time back to the default 30 minutes. script then sleeps to give
the drive time to spin down. This runs about 43-44 times an hour.
I couldn't figure at first why the sd.c 15 second timeout was timing out in
9 seconds but finally traced this to a seperate timeout value specified in
scsi_ioctl.c which is only 9 seconds as opposed to the 15 second timeout in
sd.c that I expected to be used. The scsi code is certainly a bit of a
tangled web with various different timeout values in different parts of the
code:)
Changing the timeout in scsi_ioctl.c to 15 seconds as in sd.c and re-running
the script for about 12 hours over night and some of today was successful
with no timeouts.
Attached is an updated patch against 2.0.29 and an almost identical patch
against 2.1.42. It appears blank lines in sd.c in 2.0.29 have trailing
spaces, where as sd.c in 2.1.42 does not. How the patch applied to both
before is a mystery.
Richard
begin 644 rem-patch.tar.gz
M'XL(`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