Hi
Quote:
Originally Posted by solid_state
This sounds very strange,doesn't Linux
accommodate for this scenario where a user simply yanks a drive? Does anyone know how to handle this scenario gracefully in Linux,programmatically?
Is there any way to find out what file handles are open on a particular partition/device or selectively flush and close all file handles only for a particular device ?
|
The thing is, AFAIK, if you execute read() function, the error return value doesn't include something like "the device that contains your read target doesn't exist anymore". The closest I saw in "man read" in EIO, which means I/O error. And I doubt that any recent application really anticipate all of the error return value *very carefully*.
IMHO, all of the existing OSes also don't anticipate this kind of situation, since it's more like accident rather than systematical error. It's like as bad as you got sudden error in your MBR, only more awful