Re: Important: fs corruption with 2.0.33 and removable media

Eric Youngdale (eric@andante.jic.com)
Sun, 8 Mar 1998 23:58:20 -0500 (EST)


Ahh, I think I see the problem. Never mind my previous response.
Please try the enclosed (and completely untested) patch. I believe that
it will correct the problem provided that I have correctly understood what
the problem is.

-Eric

"The world was a library, and its books were the stones, leaves,
brooks, grass, and the birds of the earth. We learned to do what only
a student of nature ever learns, and that was to feel beauty."
Chief Luther Standing Bear - Teton Sioux
On Tue, 3 Mar 1998, Richard Waltham wrote:

Index: sg.c
===================================================================
RCS file: /mnt/ide/home/eric/CVSROOT/linux/drivers/scsi/sg.c,v
retrieving revision 1.5
diff -c -r1.5 sg.c
*** sg.c 1997/12/08 01:15:56 1.5
--- sg.c 1998/03/09 04:00:59
***************
*** 350,355 ****
--- 350,367 ----
break;
}

+ if (driver_byte(result) != 0
+ && (SCpnt->sense_buffer[0] & 0x7f) == 0x70
+ && (SCpnt->sense_buffer[2] & 0xf) == UNIT_ATTENTION
+ && device->removable)
+ {
+ /*
+ * detected disc change. Set the bit - this may be used if there
+ * are filesystems using this device.
+ */
+ device->changed = 1;
+ }
+
/*
* Now wake up the process that is waiting for the
* result.

> Wolfram@informatik.uni-bonn.de wrote:
> >
> > There is a very disastrous bug in 2.0.33 (untested with 2.1.x):
> > The disc change detection with removable media is not 100% working !
> > This has a destroying effect if your computer has enough RAM for caching.
> > [tested... :-(((( ]
> >
> > Please test the following with your hardware: (reproduce able for me)
> > -mount the media and unmount it
> > -eject the media
> > -insert another media
> > -wait ~ 30 min. without doing anything at your computer (important !)
> > -mount this media (better mount it ro for safety !)
> > -no disc change detection.... (look at the kernel logs)
> >
> > It looks like the disc change has been forgotten in these 30 min.
> > The disc change detection works normal if the change and mount happens within
> > less time.
> >
> > The hardware: Fujitsu M2512A2 (230MB MO Drive & 230MB Media)
> > ncr53c825 SCSI interface (with Gerard Roudier's driver)
> >
> >
> > Is this reproduce able by other people ?
> >
> > Is there any possibility to fix this bug inside the kernel ?
> > E.g. test every minute for disc change detection ?
> >
>
> No problem here - but I'm not using an M2512A. Using an Iomega jaz shows no
> problems trying the above. Also using ncr53c8xx driver;)
>
> Disk change is dependent on the drive reporting that the media has changed
> when it gets a SCSI command to do something. Its not something that the
> kernel keeps a track of.
>
> Is your drive set to automatically spin down? I have tried one of these
> drives (a really old one) on this machine but cannot remember if it's always
> set to automatically spin down or whether it is set by one of the switches.
>
> Could this be a bug in the drive firmware? eg remove media, load new, let it
> sit for sometime - maybe drive spins down and forgets disk change - mount
> new media, spins up and no disk change notification.
>
> This really sounds like a drive problem even if it is not set to spin down.
> It is the drives job to say the media has changed.
>
> Bye for now
> Richard
>
> --
> Richard Waltham | Work: richard@digtalinterface.demon.co.uk
> At home in | Home: dormouse@farsrobt.demon.co.uk
> Southampton UK | 100421.1276@compuserve.com
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.rutgers.edu
>

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