Re: Hundreds of bugs in 2.3.99-pre3

From: Steve Dodd (steved@loth.demon.co.uk)
Date: Mon Apr 03 2000 - 17:16:02 EST


On Mon, Apr 03, 2000 at 10:44:11PM +0100, Tim Waugh wrote:
> On Mon, 3 Apr 2000, Steve Dodd wrote:

> > Is there any chance of making the higher-level subsystems module-aware
> > for any of these cases, as was done with the VFS for 2.3.99preX?
>
> How?

include/linux/fs.h now has:

#define DECLARE_FSTYPE(var,type,read,flags) \
struct file_system_type var = { \
        name: type, \
        read_super: read, \
        fs_flags: flags, \
        owner: THIS_MODULE, \
}

and fs/super.c:get_fs_type() does

[..]
fs = *(find_filesystem(name));
        if (fs && !try_inc_mod_count(fs->owner))
                fs = NULL;
        spin_unlock(&file_systems_lock);
        if (!fs && (request_module(name) == 0)) {
                spin_lock(&file_systems_lock);
                fs = *(find_filesystem(name));
                if (fs && !try_inc_mod_count(fs->owner))
                        fs = NULL;
[..]

(some other functions also do appropriate magic)

> I think any solution like that would only really be a work-around, and
> that the drivers themselves should be fixed to just know that they have to
> do MOD_INC_USE_COUNT as their first action, and undo it if need be.

The less the drivers have to do, the better IMNSHO -- less chance for them
to do it wrong ;) I'm sure there were other advantages to the VFS changes,
but they escape me at the moment. Actually, try Al's original post to
linux-fsdevel: <Pine.LNX.4.10.10003110141210.690-100000@aviro.devel.redhat.com>
(Sat, 11 Mar 2000 02:01:06 -0500).

-- 
The phrase "and then the company is screwed" is never something you want to
put in your business plan.
                -- Bruce Schneier, "Security Pitfalls in Cryptography"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:10 EST