On Thu, 29 Jun 2000, Richard Gooch wrote:
> What happens when you try (user-space) mounting a FS_SINGLE filesystem
> without calling kern_mount() first?
I get an oops at the line of code I mentioned - it wasn't a theoretical
oops but a practical one :)
Basically, I was documenting file_system_type structure and wrote:
<item><bf>read_super</bf> - a pointer to the function that reads the super
block during mount operation. This function is required - if it is
not
provided, mount operation (whether from userspace or inkernel) will
always fail except in FS_SINGLE case where it will Oops in
get_sb_single() trying to dereference a NULL pointer in
fs_type->kern_mnt->mnt_sb with (fs_type->kern_mnt = NULL) if the
module did not call kern_mount() in the initialisation routine after
filesystem was successfully registered by register_filesystem().
Now, it would sound much nicer if I could just say instead:
<item><bf>read_super</bf> - a pointer to the function that reads the super
block during mount operation. This function is required - if it is
not provided, mount operation (whether from userspace or
inkernel) will always fail.
Don't you agree? So, to test it I wrote a trivial filesystem that sets
FS_SINGLE and yet provides no read_super in fs_type and discovered the
oops. Then I added a dummy (always failing) read_super() and it oops'd
exactly the same - so it doesn't matter if read_super is NULL or not for
this thing (which reading read_super() function suggests anyway).
Regards,
Tigran