>all ->read_super() should do is read the superblock!
You're taking it kind of literally, aren't you? These days, superblock is
a metaphor. Lots of filesystems don't have real superblocks. I think if
we were naming ->read_super() today, we'd name it ->mount().
>Ideally, we should let VFS do exclusion between mount/umount and remove
>lock_super() from there. Then it becomes fs-private thing. It's not too
>hard now - most of the stuff it depends on is already in the tree.
I don't think the filesystem driver can do mount/unmount exclusion. What
you're trying to serialize is the very existence of the filesystem driver
-- Once ->write_super() is running it's too late to lock out another
process which might be in the middle of unregistering the fileystem type
and eliminating write_super().
But since we're on the topic of filesystem driver coordination of mount and
unmount, I think a useful enhancment in this area would be for ->put_super
() to be able to refuse the unmount, with a bad return code. Then the
concept of the filesystem being busy could be pushed into the VFS layer.
In complex filesystems, there may be more to it than just files in use.
>This deadlocks ext3, which wants to call ext3_truncate()
>inside ext3_read_super().
This is the part I don't get. Does ext3_truncate() acquire the superblock
lock? If so, that would seem to be the problem -- it's a layering
violation.
On the other hand, along the same lines of complex stuff being done in
->read_super(), I've run into grief because read_super() is expected to go
all the way to accessing the root directory and creating an inode and
dentry for it. That's a big job on the network filesystem I'm working on,
and it's all done under the mount semaphore so everyone else has to wait
for it. If it crashes, that's it for mounting and mounting until a hard
reboot.
On AIX, the same filesystem type doesn't present a problem because the
->read_super() function is split in two. The filesystem can be fully
mounted and registered and everything without the root directory having
been accessed. The root directory gets accessed the first time someone
actually needs to get to a file.
In Linux, if we could just have separate ->read_super() and read_root(),
with the mount semaphore dropped in between, it would probably solve the
problem.
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]