11/11/2023 0 Comments Ms process explorerAs an admin you may want to force an unmount, but instead the linux driver locks up, which is obnoxious! I’ll use “mount -l” to perform a “lazy unmount”, which at least hides the bad mount point, although it doesn’t fully clear it from the kernel. I mentioned network file systems earlier, but it can also happen with bad media. It can be useful for automation scripts, but these utilities are still affected by the kernel bugs responsible for lockups and there are times when nothing can be done short of a reboot. Also “fuser -k -m mountpoint” to kill processes that are keeping a mountpoint locked. Even with copy-on-write the inefficiency of forking large processes can become problematic. Fork is very clever but it’s highly dependent on over-provisioned memory and the OOM killer, which have real cons. I don’t like fork semantics and prefer explicitly spawning children. So I think killing the processes is probably appropriate. No matter what you may end up with undesired application behavior. Say we’re talking about outlook or windows explorer, killing the process seems bad, but not killing the process and exposing it to zombie file handles could expose even deeper issues. The bigger dilemma might be how to appropriately force a file to be closed while minimizing side effects.Ģ) Should the file be closed on behalf of the application such that the application receives invalid handle errors?ģ) Should the open file be turned into a tombstone? I’m not sure of OLE’s details either but I don’t think it matters since a process’s file table either contains the requested file or not. The data structures may not be efficient (ie maybe it requires a scan of all processes), but in principal it should always be possible to find the relationship between open files and processes in a kernel driver that has access to kernel structures. But recently it did not help anymore (I think it has something to do with Kernel namespaces, possibly docker and/or systemd, but not sure). Previously lsof was very helpful for me in identifying straggler jobs holding onto those. Duplicate ones (fork()) would be not be possible, but at least it would narrow it down a lot.Īnd, on the other side: Yes, Linux has implicit file locks, but only across mount points. If we had a time machine, they could have fixed child processes. Also add in things like cross-process interactions (OLE, shell extensions, …) this might get more interesting (but I am not sure how exactly those are handled). I think this was discussed here before, but essentially Win32 file handles are not always unique, and can be shared among processes: Īny child and duplicated process might inherit them (fun side note: someone copied Cygwin’s fork() code as a generic Win32 helper: )Īnyway, they would make the actual owner hard to find (there would be a bunch of different owners). I agree, Windows could have done better on file handle ownership. I had to force a reboot to clear the kernel condition. Even the onscreen timeout countdown failed…I was able to open another console, but it didn’t help because umount would just freeze. When I shut down the host, the VM shut down as expected, but it caused the host’s umount operation to fail and consequently the host locked up during the shutdown process. While it might seem silly, I had a reason to do it but I forgot to unmount the share. I encountered this the other week, I was running a VM and mounted a network share from the VM onto the host. There are race conditions in the kernel that can lock up the machine, One may not experience these under normal conditions, but say you’re using a network file system and need to unmount a FS, linux can be a royal pain about this because there’s no way to force an unmount operation. On a similar note I’d add that linux has some pretty major issues with open files locking mount points. One might reasonably expect the resources of a deleted file to be freed immediately, but it’s not the case on linux. As for deletion, to be honest the linux approach of inodes lingering after deletion is somewhat less intuitive. The inability to rename files has bitten me on windows many times. I do prefer being able to move/rename open files(ie libreoffice files, pdf files, log files, etc) as linux allows. However IMHO it is a pretty dumb limitation that the UI doesn’t 1) clearly show what’s holding a lock and 2) let you kill it. I honestly don’t mind the windows approach of locking files, it makes sense. While that is generally better, it is still a trade-off.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |