[3430] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

[RU.LINUX] =?ISO-8859-1?Q?=CF=D0=D1=D4=D8...?= =?ISO-8859-1?Q?=CE=D5,?= =?ISO-8859-1?Q?=D3=CB=C1=D6=C5=CD,?= =?ISO-8859-1?Q?=CF?= =?ISO-8859-1?Q?=C4=C5=D7=CF=DE=CB=C1=C8.?=

daemon@ATHENA.MIT.EDU (Boris Tobotras)
Sun Mar 1 23:44:27 1998

To: linux-scsi@vger.rutgers.edu
From: Boris Tobotras <boris@xtalk.msk.su>
Date: 	02 Mar 1998 07:40:47 +0300

--Multipart_Mon_Mar__2_07:40:47_1998-1
Content-Type: text/plain; charset=US-ASCII


	This message was posted to russian-speaking fidonet conference
RU.LINUX. Here is a translation.
 
			* * *

I've already wrote -- stupid linux allows for doing umount
/external-scsi-drive ; echo 'scsi-remove-single-device 0 0 0 0' >
/proc/scsi/scsi, turn its power off... and loose up to meg of data. Because 
it have no idea about cache flush. Especially pleasing is that root dir of
device is usually goes to hell. 

Patch is not in exact place where it actually belongs, but I feel it even
better -- I don't feel like having unflushed cache even on non-removable
device. 

Those who're willing can translate this to linux-scsi.

			* * *

	So I do. One more question for me: what about write cache of SCSI
drive itself? What have one do to do robust flush of it befure power off? 

-- 
	Best regards, -- Boris.

Anyone can build a fast processor. The trick is to build a fast system.
        -- Seymour Cray

--Multipart_Mon_Mar__2_07:40:47_1998-1
Content-Type: message/rfc822

Newsgroups: RU.LINUX
From: Alex Korchmar <Alex_Korchmar@p100.f28.n5020.z2.fidonet.org>
Date: Sun, 01 Mar 98 23:16:20 +0300
Subject: опять... ну, скажем, о девочках.
Message-ID: <2095379544@p100.f28.n5020.z2.fidonet>
Organization: Down System

Hi All,

   я уже, собственно, как-то раз писал - дурацкий линукс позволяет сказать 
umount /external-scsi-drive ; echo 'scsi-remove-single-device 0 0 0 0' >
/proc/scsi/scsi, выключить ему питание... и потерять до мегабайтика данных.
Поскольку не соображает, что кэш вообще-то надо сбрасывать. Особенно приятно,
что летит к чертям как правило корень этого драйва.
Патч немного не в том месте, где ему следовало бы быть, но так, на мой взгляд,
даже лучше - после umount мне как-то неприятно иметь несброшенные кэши даже и в
нес'емном драйве. 

Желающие могут пересказать это в linux-scsi.

=== cut here ====
*** linux-2.0.33/drivers/scsi/sd.c	Tue Feb 17 13:30:09 1998
- --- linux/drivers/scsi/sd.c	Sun Mar  1 21:18:34 1998
***************
*** 149,152 ****
- --- 149,156 ----
  {
      int target;
+     struct sdata {
+     	int inlen, outlen;
+     	char cmd[19];
+     } scsi_cmd;
      fsync_dev(inode->i_rdev);
      
***************
*** 158,164 ****
      if(sd_template.usage_count) (*sd_template.usage_count)--;
      
!     if(rscsi_disks[target].device->removable) {
! 	if(!rscsi_disks[target].device->access_count)
! 	    sd_ioctl(inode, NULL, SCSI_IOCTL_DOORUNLOCK, 0);
      }
  }
- --- 162,174 ----
      if(sd_template.usage_count) (*sd_template.usage_count)--;
      
!     if(!rscsi_disks[target].device->access_count) {
!     
!     	    scsi_cmd.inlen=scsi_cmd.outlen=0;
!     	    scsi_cmd.cmd[0]=SYNCHRONIZE_CACHE;
!     	    memset(scsi_cmd.cmd+1, 0, 18);
!     	    sd_ioctl(inode, NULL, SCSI_IOCTL_SEND_COMMAND, &scsi_cmd); /* you
can safely turn off external device */
! 	    
!     	    if(rscsi_disks[target].device->removable)
! 	    	    sd_ioctl(inode, NULL, SCSI_IOCTL_DOORUNLOCK, 0);
      }
  }

=== cut here ====



> Alex


--Multipart_Mon_Mar__2_07:40:47_1998-1--


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post