I'm observing all sorts of race conditions occurring in various VNOPs my custom filesystem implements. I'm inclined to attribute this to my implementation not following the locking rules expected by the system of a 3rd party filesystem as well as it should. ... Thus my question, what are the locking rules for VFS and VNOP operations? The term rules here is very misleading. On it's own, the VFS system doesn't necessarily require any locks at all. When you look at something like this: I've looked at how locking is done in Apple's own implementation of Samba and NFS clients. The Samba client uses read/write locks to protect its node from data races. While the NFS client uses mutex locks for the same purpose. While some of those looks are about the vfs implemenation itself (VNOP_LOOKUP is one example), most of the locking are about ensuring the the file system itself behave in a sane matter. As the simplest example, it's hard to see how a basic operation like file moving could be implemented unl
Topic:
App & System Services
SubTopic:
Core OS
Tags: