Format Unit can take many hours
Subsystems (2)
PATCH 1/1 Format Unit can take many hours
Hi,
the timeout for FORMAT_UNIT should be much longer; I've seen 8hrs already (75Gig). I've increased the timeout from 2hrs to 12hrs.
Regards,
Signature · 2 lines
Kurt Garloff <[email protected]> Cologne, DE SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)
drivers/scsi/scsi_ioctl.c +3 -3
@@ -26,12 +26,12 @@#include "scsi_logging.h" #define NORMAL_RETRIES 5 -#define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define IOCTL_NORMAL_TIMEOUT (10 * HZ) +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ)#define START_STOP_TIMEOUT (60 * HZ)#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* ZIP-250 on parallel port takes as long! */ +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ)/* ZIP-250 on parallel port takes as long! */ #define MAX_BUF PAGE_SIZE
Quoted 17 lines · Kurt Garloff
Hi,
the timeout for
FORMAT_UNITshould be much longer; I've seen 8hrs already (75Gig). I've increased the timeout from 2hrs to 12hrs.Regards,
Signature · 2 lines
Kurt Garloff <[email protected]> Cologne, DE SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)drivers/scsi/scsi_ioctl.c +0
-1@@ -26,12 +26,12 @@#include "scsi_logging.h" #define NORMAL_RETRIES 5 -#define IOCTL_NORMAL_TIMEOUT (10 * HZ)
drivers/scsi/scsi_ioctl.c line 36
Quoted 10 lines
drivers/scsi/scsi_ioctl.c +3
-2-#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define IOCTL_NORMAL_TIMEOUT (10 * HZ) +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ)#define START_STOP_TIMEOUT (60 * HZ)#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* ZIP-250 on parallel port takes as long! */ +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ)/* ZIP-250 on parallel port takes as long! */ #define MAX_BUF PAGE_SIZE
block/scsi_ioctl.c should likely receive similar treatment then.
Signature · 1 line
Jens Axboe
Quoted 3 lines · Jens Axboe
Quoted 1 line · Kurt Garloff
Hi,
block/scsi_ioctl.cshould likely receive similar treatment then.
how about sticking these in a shared header between the 2 files ?
Hi Jens,
Quoted 1 line · Jens Axboe
block/scsi_ioctl.cshould likely receive similar treatment then.
Good point.
Signature · 2 lines
Kurt Garloff <[email protected]> Cologne, DE SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)
drivers/scsi/scsi_ioctl.c +3 -3
@@ -26,12 +26,12 @@#include "scsi_logging.h" #define NORMAL_RETRIES 5 -#define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define IOCTL_NORMAL_TIMEOUT (10 * HZ) +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ)#define START_STOP_TIMEOUT (60 * HZ)#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* ZIP-250 on parallel port takes as long! */ +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ)/* ZIP-250 on parallel port takes as long! */ #define MAX_BUF PAGE_SIZE
drivers/block/scsi_ioctl.c renamed from drivers/block/scsi_ioctl.c.orig +2 -2
@@ -209,11 +209,11 @@ static int sg_io(request_queue_t *q, strreturn 0 ; } -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ)#define START_STOP_TIMEOUT (60 * HZ)#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ)#define OMAX_SB_LEN 16/* For backward compatibility */ static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
Quoted 6 lines · Arjan van de Ven
Quoted 3 lines · Jens Axboe
Quoted 1 line · Kurt Garloff
Hi,
block/scsi_ioctl.cshould likely receive similar treatment then.how about sticking these in a shared header between the 2 files ?
yep would be best, ala
===== drivers/block/scsi_ioctl.c 1.42 vs edited =====
drivers/block/scsi_ioctl.c +0 -5
@@ -209,11 +209,6 @@return 0 ; } -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) -#define START_STOP_TIMEOUT (60 * HZ) -#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) -#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )#define OMAX_SB_LEN 16/* For backward compatibility */ static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
===== drivers/scsi/scsi_ioctl.c 1.24 vs edited =====
drivers/scsi/scsi_ioctl.c +0 -5
@@ -27,11 +27,6 @@#define NORMAL_RETRIES 5#define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) -#define START_STOP_TIMEOUT (60 * HZ) -#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) -#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* ZIP-250 on parallel port takes as long! */ #define MAX_BUF PAGE_SIZE
===== include/scsi/scsi.h 1.20 vs edited =====
include/scsi/scsi.h +8 -0
@@ -362,6 +362,14 @@#define SCSI_2 3#define SCSI_3 4 +/* +* default timeouts +*/ +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ) +#define START_STOP_TIMEOUT (60 * HZ) +#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) +#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* * Here are some scsi specific ioctl commands which are sometimes useful.
Signature · 1 line
Jens Axboe
Quoted 2 lines · Kurt Garloff
the timeout for
FORMAT_UNITshould be much longer; I've seen 8hrs already (75Gig). I've increased the timeout from 2hrs to 12hrs.
If you execute a FORMAT_UNIT properly, the timeout is irrelevant. Set the IMMED bit so the command returns as soon as the drive begins processing it. Send TEST_UNIT_READY to check the progress. I'll have to consult the spec, but I think support for Immed is required.
That's how my (now 8 year old) tool for formating scsi devices (zip, jaz, hard disks, tapes, etc.) has always worked. [No, it is not published code. If the script kiddies want to low-level your hard drive, they're gonna have to learn how to do it themselves.]
--Ricky
PS: That even works under Solaris where one does not have the source code
to change the command timeouts.
Quoted 28 lines · Jens Axboe
Quoted 26 lines · Kurt Garloff
Hi,
the timeout for
FORMAT_UNITshould be much longer; I've seen 8hrs already (75Gig). I've increased the timeout from 2hrs to 12hrs.Regards,
Signature · 1 line
Kurt Garloff <[email protected]> Cologne, DE SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)drivers/scsi/scsi_ioctl.c +3
-3@@ -26,12 +26,12 @@#include "scsi_logging.h" #define NORMAL_RETRIES 5 -#define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define IOCTL_NORMAL_TIMEOUT (10 * HZ) +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ)#define START_STOP_TIMEOUT (60 * HZ)#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* ZIP-250 on parallel port takes as long! */ +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ)/* ZIP-250 on parallel port takes as long! */
Quoted 4 lines
drivers/scsi/scsi_ioctl.c line 36
Quoted 1 line
drivers/scsi/scsi_ioctl.c +0
-0#define MAX_BUF PAGE_SIZE
block/scsi_ioctl.cshould likely receive similar treatment then.
This timeout is dependent on media size, I should think...
Is there any reason to think that this timeout will _not_ be continually patched in the future, as larger and larger sizes are used?
Jeff
Quoted 40 lines · Jeff Garzik
Quoted 33 lines · Jens Axboe
Quoted 31 lines · Kurt Garloff
Hi,
the timeout for
FORMAT_UNITshould be much longer; I've seen 8hrs already (75Gig). I've increased the timeout from 2hrs to 12hrs.Regards,
Signature · 8 lines
Kurt Garloff <[email protected]> Cologne, DE SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head) --- linux-2.6.5.orig/drivers/scsi/scsi_ioctl.c 2004-04-04 05:38:20.000000000 +0200 +++ linux-2.6.5/drivers/scsi/scsi_ioctl.c 2004-05-11 08:59:12.837421215 +0200drivers/scsi/scsi_ioctl.c +2
-3@@ -26,12 +26,12 @@#include "scsi_logging.h" #define NORMAL_RETRIES 5 -#define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define IOCTL_NORMAL_TIMEOUT (10 * HZ) +#define FORMAT_UNIT_TIMEOUT (12 * 60 * 60 * HZ)#define START_STOP_TIMEOUT (60 * HZ)#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )/* ZIP-250 on parallel port takes as long! */
+#defineREAD_DEFECT_DATA_TIMEOUT(60 * HZ) /* ZIP-250 on parallel
port takes as long! */Quoted 4 lines
Quoted 1 line
#define
MAX_BUFPAGE_SIZE
block/scsi_ioctl.cshould likely receive similar treatment then.
Quoted 4 lines
This timeout is dependent on media size, I should think...
Is there any reason to think that this timeout will _not_ be continually patched in the future, as larger and larger sizes are used?
I think the timeout is only used for ancient programs that use the old sg interface. Newer programs should pass in the timeout themselves, or set IMMED as somebody else in this thread noted.
So I do think the easiest is just to patch this define for the odd case, and forget about it.
Signature · 1 line
Jens Axboe
Hi,
Quoted 8 lines · Jens Axboe
Quoted 7 lines · Jeff Garzik
Quoted 1 line · Jens Axboe
block/scsi_ioctl.cshould likely receive similar treatment then.This timeout is dependent on media size, I should think...
Is there any reason to think that this timeout will _not_ be continually patched in the future, as larger and larger sizes are used?
The disks gets faster as well.
But if we have to touch it every three years, I don't see this as a huge problem either. If you want some more room, you can set it to 24hrs now ...
Quoted 3 lines
I think the timeout is only used for ancient programs that use the old sg interface. Newer programs should pass in the timeout themselves, or set IMMED as somebody else in this thread noted.
If you do use the sg interface, you can specify the timeout. If you use SCSI_IOCTL_SEND_COMMAND, there's no way to do it and the value from scsi_ioctl.c applies.
scsiformat is one of the users.
Quoted 2 lines
So I do think the easiest is just to patch this define for the odd case, and forget about it.
Agreed.
Regards,
Signature · 2 lines
Kurt Garloff <[email protected]> Cologne, DE SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)
Quoted 8 lines · Ricky Beam
Quoted 2 lines · Kurt Garloff
the timeout for
FORMAT_UNITshould be much longer; I've seen 8hrs already (75Gig). I've increased the timeout from 2hrs to 12hrs.If you execute a
FORMAT_UNITproperly, the timeout is irrelevant. Set the IMMED bit so the command returns as soon as the drive begins processing it. SendTEST_UNIT_READYto check the progress. I'll have to consult the spec, but I think support for Immed is required.
Moreover, it simply "feels" wrong to define a constant for something that isn't... The quick fix of increasing the timeout doesn't address the underlying issue of how long a format should take, and as Ricky implies, that's probably more the concern of the application rather than the driver.
Signature · 4 lines
----------------------------------------------------------------------- Bob Tracy WTO + WIPO = DMCA? http://www.anti-dmca.org [email protected] -----------------------------------------------------------------------
Quoted 5 lines · Bob Tracy
Moreover, it simply "feels" wrong to define a constant for something that isn't... The quick fix of increasing the timeout doesn't address the underlying issue of how long a format should take, and as Ricky implies, that's probably more the concern of the application rather than the driver.
The real problem is a lack of being able to specify a timeout for user supplied commands. In-kernel drivers can set a command timeout. The IOCTL interface does not export that capability.
--Ricky
Quoted 9 lines · Kurt Garloff
Hi,
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Jeff Garzik
Quoted 1 line · Jens Axboe
block/scsi_ioctl.cshould likely receive similar treatment then.This timeout is dependent on media size, I should think...
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Is there any reason to think that this timeout will _not_ be continually patched in the future, as larger and larger sizes are used?
The disks gets faster as well.
But if we have to touch it every three years, I don't see this as a huge problem either. If you want some more room, you can set it to 24hrs now ...
Precisely. No need to over-engineer.
Quoted 8 lines
Quoted 4 lines
I think the timeout is only used for ancient programs that use the old sg interface. Newer programs should pass in the timeout themselves, or set IMMED as somebody else in this thread noted.
If you do use the sg interface, you can specify the timeout. If you use
SCSI_IOCTL_SEND_COMMAND, there's no way to do it and the value fromscsi_ioctl.capplies.
Even the oldest sg interface? SCSI_IOCTL_SEND_COMMAND should have been put to rest at least 5 years ago :)
Signature · 1 line
Jens Axboe
Quoted 10 lines · Ricky Beam
Quoted 5 lines · Bob Tracy
Moreover, it simply "feels" wrong to define a constant for something that isn't... The quick fix of increasing the timeout doesn't address the underlying issue of how long a format should take, and as Ricky implies, that's probably more the concern of the application rather than the driver.
The real problem is a lack of being able to specify a timeout for user supplied commands. In-kernel drivers can set a command timeout. The IOCTL interface does not export that capability.
Noone should use that interface, period. That ioctl is about as bad an interface as you could imagine. Use any variant of sg and you should be fine.
Signature · 1 line
Jens Axboe