]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
vfs: simple_set_mnt() should return void
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Wed, 4 Mar 2009 20:06:34 +0000 (12:06 -0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 27 Mar 2009 18:44:03 +0000 (14:44 -0400)
simple_set_mnt() is defined as returning 'int' but always returns 0.
Callers assume simple_set_mnt() never fails and don't properly cleanup if
it were to _ever_ fail.  For instance, get_sb_single() and get_sb_nodev()
should:

        up_write(sb->s_unmount);
        deactivate_super(sb);

if simple_set_mnt() fails.

Since simple_set_mnt() never fails, would be cleaner if it did not
return anything.

[akpm@linux-foundation.org: fix build]
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/mtd/mtdsuper.c
fs/9p/vfs_super.c
fs/cifs/cifsfs.c
fs/devpts/inode.c
fs/libfs.c
fs/namespace.c
fs/proc/root.c
fs/super.c
fs/ubifs/super.c
include/linux/fs.h
kernel/cgroup.c

index 00d46e137b2ab306ca3775c4f216d6016a44df37..92285d0089c278dd0e72a60f58f7a912b831f1ec 100644 (file)
@@ -81,13 +81,16 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
 
        /* go */
        sb->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+
+       return 0;
 
        /* new mountpoint for an already mounted superblock */
 already_mounted:
        DEBUG(1, "MTDSB: Device %d (\"%s\") is already mounted\n",
              mtd->index, mtd->name);
-       ret = simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       ret = 0;
        goto out_put;
 
 out_error:
index 93212e40221ac10d39757a09cdacffb8fb922edb..5f8ab8adb5f5d7bd47fe65c61a25df8d78b82ca3 100644 (file)
@@ -168,8 +168,9 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
        p9stat_free(st);
        kfree(st);
 
-P9_DPRINTK(P9_DEBUG_VFS, " return simple set mount\n");
-       return simple_set_mnt(mnt, sb);
+P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
+       simple_set_mnt(mnt, sb);
+       return 0;
 
 release_sb:
        if (sb) {
index 13ea53251dcf934518889696e7222286c13aefde..38491fd3871df31258d0cd77efb1ba2d74f9cf52 100644 (file)
@@ -606,7 +606,8 @@ cifs_get_sb(struct file_system_type *fs_type,
                return rc;
        }
        sb->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 }
 
 static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
index 140b43144cd823f3b9e530481fe2084a81a4cff2..b0a76340a4cd6dffc89e5897edbeec6aee5ce669 100644 (file)
@@ -454,7 +454,8 @@ static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
                s->s_flags |= MS_ACTIVE;
        }
        do_remount_sb(s, flags, data, 0);
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 }
 
 /*
index ec600bd33e75b041c133532eae6cd6c88923db48..4910a36f516e3081bcb61713260bb2ca637a9612 100644 (file)
@@ -242,7 +242,8 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        d_instantiate(dentry, root);
        s->s_root = dentry;
        s->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 
 Enomem:
        up_write(&s->s_umount);
index 06f8e63f6cb1dc929e0ad9c0627320066db57cb1..2432ca6bb223e75fc5aaeebfad8e484a45140b4d 100644 (file)
@@ -397,11 +397,10 @@ static void __mnt_unmake_readonly(struct vfsmount *mnt)
        spin_unlock(&vfsmount_lock);
 }
 
-int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
+void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
 {
        mnt->mnt_sb = sb;
        mnt->mnt_root = dget(sb->s_root);
-       return 0;
 }
 
 EXPORT_SYMBOL(simple_set_mnt);
index f6299a25594e78a7527972930104924434c361c9..1e15a2b176e85a69a4657790009c58976c6dab75 100644 (file)
@@ -83,7 +83,8 @@ static int proc_get_sb(struct file_system_type *fs_type,
                ns->proc_mnt = mnt;
        }
 
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 }
 
 static void proc_kill_sb(struct super_block *sb)
index 6ce501447ada090cac2f5d8ec575030070356831..e512fab64c936f4134de6420236fb24f7de0534c 100644 (file)
@@ -831,7 +831,8 @@ int get_sb_bdev(struct file_system_type *fs_type,
                bdev->bd_super = s;
        }
 
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 
 error_s:
        error = PTR_ERR(s);
@@ -877,7 +878,8 @@ int get_sb_nodev(struct file_system_type *fs_type,
                return error;
        }
        s->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 }
 
 EXPORT_SYMBOL(get_sb_nodev);
@@ -909,7 +911,8 @@ int get_sb_single(struct file_system_type *fs_type,
                s->s_flags |= MS_ACTIVE;
        }
        do_remount_sb(s, flags, data, 0);
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 }
 
 EXPORT_SYMBOL(get_sb_single);
index 1182b66a5491443ac725504ec3bd7e3bf0b0dc30..c5c98355459a5fcfab9312b3719e3695c440aadd 100644 (file)
@@ -2034,7 +2034,8 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags,
        /* 'fill_super()' opens ubi again so we must close it here */
        ubi_close_volume(ubi);
 
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 
 out_deact:
        up_write(&sb->s_umount);
index c2c4454a268a54585015cb66e57909d4e6059bba..a7d73914a9f73f7c9edebf3084b30f31fed7ee80 100644 (file)
@@ -1719,7 +1719,7 @@ struct super_block *sget(struct file_system_type *type,
 extern int get_sb_pseudo(struct file_system_type *, char *,
        const struct super_operations *ops, unsigned long,
        struct vfsmount *mnt);
-extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
+extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
 int __put_super_and_need_restart(struct super_block *sb);
 
 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
index b01100ebd074673986ebb694004af973a172430d..c500ca7239b21a465831e2b3f0454f14505ff3e9 100644 (file)
@@ -1071,7 +1071,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
                mutex_unlock(&cgroup_mutex);
        }
 
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 
  free_cg_links:
        free_cg_links(&tmp_cg_links);