Handling of refcounts for FS_SINGLE filesystems moved to
add_vfsmnt(). That's the first half of real fix for FS_SINGLE mess -
we should make it "read_super() if we hadn't done it yet, otherwise
return what we have". That will make kern_mount() uses simpler and
remove all special-casing with refcounts. in the hindsight, the trick
I've used in 2.4.0-test2 merge was ugly - kern_mount() should be used
only when kernel explicitly asks for a vfsmount of its own, not as
as part of init for FS_SINGLE filesystems. Fix is easy, but that chunk
touches several files besides fs/super.c and requires sane locking
to be safe. Patch below is the preliminary part local to fs/super.c.

        Please, apply.

diff -urN S5-pre6-kern_mount/fs/super.c S5-pre6-single1/fs/super.c
--- S5-pre6-kern_mount/fs/super.c       Fri May 25 15:07:19 2001
+++ S5-pre6-single1/fs/super.c  Fri May 25 15:12:36 2001
@@ -367,6 +367,8 @@
        list_add(&mnt->mnt_instances, &sb->s_mounts);
        list_add(&mnt->mnt_list, vfsmntlist.prev);
        spin_unlock(&dcache_lock);
+       if (sb->s_type->fs_flags & FS_SINGLE)
+               get_filesystem(sb->s_type);
 out:
        return mnt;
 fail:
@@ -852,7 +854,6 @@
        sb = fs_type->kern_mnt->mnt_sb;
        if (!sb)
                BUG();
-       get_filesystem(fs_type);
        do_remount_sb(sb, flags, data);
        return sb;
 }
@@ -1165,8 +1166,6 @@
                goto out2;
 
        err = -ENOMEM;
-       if (old_nd.mnt->mnt_sb->s_type->fs_flags & FS_SINGLE)
-               get_filesystem(old_nd.mnt->mnt_sb->s_type);
                
        down(&mount_sem);
        /* there we go */
@@ -1177,8 +1176,6 @@
                err = 0;
        up(&new_nd.dentry->d_inode->i_zombie);
        up(&mount_sem);
-       if (err && old_nd.mnt->mnt_sb->s_type->fs_flags & FS_SINGLE)
-               put_filesystem(old_nd.mnt->mnt_sb->s_type);
 out2:
        path_release(&new_nd);
 out1:
@@ -1369,8 +1366,6 @@
        return retval;
 
 fail:
-       if (fstype->fs_flags & FS_SINGLE)
-               put_filesystem(fstype);
        kill_super(sb);
        goto unlock_out;
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to