From: David W. <dav...@ia...> - 2002-11-09 21:23:16
|
> Is there a way of doing this? I want to rewrite the vmufs driver to make it as > independent of the underlying medium as possible and so I wanto to probe the > size of the vmu. > > An obvious way is to attempt to read in vmu sectors until this fails - eg at > 128, at 256, at 512, at 1024. (Working on the suggested likely sizes for > alternative VMUs, assuming these things just might exist somewhere). > > On a standard VMU 128 would succeed, 256 would fail and a simple check would > then reveal that the superblock was in sector 255. > > But a buffer read at 256 will oops the kernel in these circumstances - is > there a mechanism to trap that exception? The solution is to make the kernel not oops. Why would it oops if the VMU says a sector doesn't exist? Does the kernel oops if a scsi disk has a bad block? Change the code that now oops's and replace it with a return of an error value. Is that practical? Cheers, David |