Hi all,
Call me stupid (no - wait until I've finished!), but aren't there major
problems in the ntfs driver as it stands? As I understand it, the VFS grabs
the kernel lock for file operations at the moment, so we don't have to worry
about the SMP situation. However, there are many situations were we access
things such as the volume bitmap, the mft, the mft bitmap, etc., without
any locking. As writing to any non-resident attribute will end up calling
bread(), which can sleep, haven't we got major races?
Take cluster allocation for example: we read the relevant part of the bitmap,
*copy* the data into another memory area, search it, free that memory, re-read
the same data, copy it again, set the relevant bits, and write it back[1].
While we're sleeping trying to re-read, another task could easily update the
bitmap, and we wouldn't see the changes. Ack. Presumably this goes for the
MFT bitmap, too.
I don't understand much about locking in filesystems, but this seems to be
an obvious no-no?
[1] Which we do strangely by calling bread() again, because we don't remember
the buffer_head.
--
20962296