[Devel] simple_pin_fs issue

Vasily Averin vvs at sw.ru
Mon Dec 12 22:22:25 PST 2005


it is 022stab054.1 kernel

diff -uprN linux-2.6.8.1.orig/fs/libfs.c linux-2.6.8.1-ve022stab054/fs/libfs.c
--- linux-2.6.8.1.orig/fs/libfs.c       2004-08-14 14:54:47.000000000 +0400
+++ linux-2.6.8.1-ve022stab054/fs/libfs.c       2005-12-12 17:51:20.000000000 +0300
@@ -412,10 +412,13 @@ static spinlock_t pin_fs_lock = SPIN_LOC
 int simple_pin_fs(char *name, struct vfsmount **mount, int *count)
 {
        struct vfsmount *mnt = NULL;
+       struct file_system_type *fstype;
        spin_lock(&pin_fs_lock);
        if (unlikely(!*mount)) {
                spin_unlock(&pin_fs_lock);
-               mnt = do_kern_mount(name, 0, name, NULL);
+               fstype = get_fs_type(name);
+               mnt = do_kern_mount(fstype, 0, name, NULL);
+               put_filesystem(fstype);
                if (IS_ERR(mnt))
                        return PTR_ERR(mnt);
                spin_lock(&pin_fs_lock);


fstype is nod checked. is it a bug?




More information about the Devel mailing list