Subject: Re: accessing IDE hard drive via pcmcia card (redirected from netbsd-users)
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Steven M. Bellovin <smb@research.att.com>
List: tech-kern
Date: 05/21/2004 16:55:17
In message <20040521203653.GC1565@antioche.eu.org>, Manuel Bouyer writes:
>On Fri, May 21, 2004 at 03:29:21PM -0400, Steven M. Bellovin wrote:
>> In message <20040521192041.GA807@antioche.eu.org>, Manuel Bouyer writes:
>> >On Sat, May 22, 2004 at 04:58:30AM +1000, Daniel Carosone wrote:
>> >> [...]
>> >> Another workaround, and interesting test, would be to turn off
>> >> write-cache on the drive:
>> >> 
>> >> 	dkctl wdX setcache r
>> >> 
>> >> and then try the unmount.  I'm hoping/assuming this would wait for the
>> >> superblock write to complete.  Could you try this?  If it does, then
>> >> building the moral equivalent of
>> >> 
>> >> 	dkctl wdX synccache force
>> >> 
>> >> into the close is the right way to fix this.  It even seems to me like
>> >> if we don't do this, there might be other similar lossage cases
>> >> lurking than the pcmcia one you found.
>> >
>> >There is already wd_flushcache() on last close in wd.c. This should be enou
>th.
>> >
>> 
>> I assume that I still need to do the 'setcache r', correct?
>
>Would be a good test. But this flush cache command should be enouth.
>Maybe adding a printf here to make sure it's called on last close would
>be usefull too.

Demonstrably, it isn't -- as I said, I'm not getting writes flushed 
properly when the drive is closed immediately afterwards.
>
>Also please update to wd.c 1.276, I just added support for DIOCCACHESYNC.
>Then you can try dkctl wdX synccache, and see if it complete without errors.
>
That's on -current?  This machine is 2.0beta.  If there are no other 
changes, I could try to merge yours and mine, and run that driver on 
2.0.

		--Steve Bellovin, http://www.research.att.com/~smb