Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fs/ncpfs: fix error paths and goto statements in ncp_fill_super()
configfs: register_filesystem() called too early
fuse: register_filesystem() called too early
ubifs: too early register_filesystem()
... and the same kind of leak for mqueue
procfs: fix a vfsmount longterm reference leak

+49 -62
+1 -1
fs/configfs/inode.c
··· 292 292 return bdi_init(&configfs_backing_dev_info); 293 293 } 294 294 295 - void __exit configfs_inode_exit(void) 295 + void configfs_inode_exit(void) 296 296 { 297 297 bdi_destroy(&configfs_backing_dev_info); 298 298 }
+18 -20
fs/configfs/mount.c
··· 143 143 goto out; 144 144 145 145 config_kobj = kobject_create_and_add("config", kernel_kobj); 146 - if (!config_kobj) { 147 - kmem_cache_destroy(configfs_dir_cachep); 148 - configfs_dir_cachep = NULL; 149 - goto out; 150 - } 151 - 152 - err = register_filesystem(&configfs_fs_type); 153 - if (err) { 154 - printk(KERN_ERR "configfs: Unable to register filesystem!\n"); 155 - kobject_put(config_kobj); 156 - kmem_cache_destroy(configfs_dir_cachep); 157 - configfs_dir_cachep = NULL; 158 - goto out; 159 - } 146 + if (!config_kobj) 147 + goto out2; 160 148 161 149 err = configfs_inode_init(); 162 - if (err) { 163 - unregister_filesystem(&configfs_fs_type); 164 - kobject_put(config_kobj); 165 - kmem_cache_destroy(configfs_dir_cachep); 166 - configfs_dir_cachep = NULL; 167 - } 150 + if (err) 151 + goto out3; 152 + 153 + err = register_filesystem(&configfs_fs_type); 154 + if (err) 155 + goto out4; 156 + 157 + return 0; 158 + out4: 159 + printk(KERN_ERR "configfs: Unable to register filesystem!\n"); 160 + configfs_inode_exit(); 161 + out3: 162 + kobject_put(config_kobj); 163 + out2: 164 + kmem_cache_destroy(configfs_dir_cachep); 165 + configfs_dir_cachep = NULL; 168 166 out: 169 167 return err; 170 168 }
+12 -12
fs/fuse/inode.c
··· 1138 1138 { 1139 1139 int err; 1140 1140 1141 - err = register_filesystem(&fuse_fs_type); 1142 - if (err) 1143 - goto out; 1144 - 1145 - err = register_fuseblk(); 1146 - if (err) 1147 - goto out_unreg; 1148 - 1149 1141 fuse_inode_cachep = kmem_cache_create("fuse_inode", 1150 1142 sizeof(struct fuse_inode), 1151 1143 0, SLAB_HWCACHE_ALIGN, 1152 1144 fuse_inode_init_once); 1153 1145 err = -ENOMEM; 1154 1146 if (!fuse_inode_cachep) 1155 - goto out_unreg2; 1147 + goto out; 1148 + 1149 + err = register_fuseblk(); 1150 + if (err) 1151 + goto out2; 1152 + 1153 + err = register_filesystem(&fuse_fs_type); 1154 + if (err) 1155 + goto out3; 1156 1156 1157 1157 return 0; 1158 1158 1159 - out_unreg2: 1159 + out3: 1160 1160 unregister_fuseblk(); 1161 - out_unreg: 1162 - unregister_filesystem(&fuse_fs_type); 1161 + out2: 1162 + kmem_cache_destroy(fuse_inode_cachep); 1163 1163 out: 1164 1164 return err; 1165 1165 }
+4 -4
fs/ncpfs/inode.c
··· 548 548 549 549 error = bdi_setup_and_register(&server->bdi, "ncpfs", BDI_CAP_MAP_COPY); 550 550 if (error) 551 - goto out_bdi; 551 + goto out_fput; 552 552 553 553 server->ncp_filp = ncp_filp; 554 554 server->ncp_sock = sock; ··· 559 559 error = -EBADF; 560 560 server->info_filp = fget(data.info_fd); 561 561 if (!server->info_filp) 562 - goto out_fput; 562 + goto out_bdi; 563 563 error = -ENOTSOCK; 564 564 sock_inode = server->info_filp->f_path.dentry->d_inode; 565 565 if (!S_ISSOCK(sock_inode->i_mode)) ··· 746 746 out_fput2: 747 747 if (server->info_filp) 748 748 fput(server->info_filp); 749 - out_fput: 750 - bdi_destroy(&server->bdi); 751 749 out_bdi: 750 + bdi_destroy(&server->bdi); 751 + out_fput: 752 752 /* 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>: 753 753 * 754 754 * The previously used put_filp(ncp_filp); was bogus, since
+3 -5
fs/proc/root.c
··· 91 91 92 92 void __init proc_root_init(void) 93 93 { 94 - struct vfsmount *mnt; 95 94 int err; 96 95 97 96 proc_init_inodecache(); 98 97 err = register_filesystem(&proc_fs_type); 99 98 if (err) 100 99 return; 101 - mnt = kern_mount_data(&proc_fs_type, &init_pid_ns); 102 - if (IS_ERR(mnt)) { 100 + err = pid_ns_prepare_proc(&init_pid_ns); 101 + if (err) { 103 102 unregister_filesystem(&proc_fs_type); 104 103 return; 105 104 } 106 105 107 - init_pid_ns.proc_mnt = mnt; 108 106 proc_symlink("mounts", NULL, "self/mounts"); 109 107 110 108 proc_net_init(); ··· 207 209 208 210 void pid_ns_release_proc(struct pid_namespace *ns) 209 211 { 210 - mntput(ns->proc_mnt); 212 + kern_unmount(ns->proc_mnt); 211 213 }
+8 -10
fs/ubifs/super.c
··· 2264 2264 return -EINVAL; 2265 2265 } 2266 2266 2267 - err = register_filesystem(&ubifs_fs_type); 2268 - if (err) { 2269 - ubifs_err("cannot register file system, error %d", err); 2270 - return err; 2271 - } 2272 - 2273 - err = -ENOMEM; 2274 2267 ubifs_inode_slab = kmem_cache_create("ubifs_inode_slab", 2275 2268 sizeof(struct ubifs_inode), 0, 2276 2269 SLAB_MEM_SPREAD | SLAB_RECLAIM_ACCOUNT, 2277 2270 &inode_slab_ctor); 2278 2271 if (!ubifs_inode_slab) 2279 - goto out_reg; 2272 + return -ENOMEM; 2280 2273 2281 2274 register_shrinker(&ubifs_shrinker_info); 2282 2275 ··· 2281 2288 if (err) 2282 2289 goto out_compr; 2283 2290 2291 + err = register_filesystem(&ubifs_fs_type); 2292 + if (err) { 2293 + ubifs_err("cannot register file system, error %d", err); 2294 + goto out_dbg; 2295 + } 2284 2296 return 0; 2285 2297 2298 + out_dbg: 2299 + dbg_debugfs_exit(); 2286 2300 out_compr: 2287 2301 ubifs_compressors_exit(); 2288 2302 out_shrinker: 2289 2303 unregister_shrinker(&ubifs_shrinker_info); 2290 2304 kmem_cache_destroy(ubifs_inode_slab); 2291 - out_reg: 2292 - unregister_filesystem(&ubifs_fs_type); 2293 2305 return err; 2294 2306 } 2295 2307 /* late_initcall to let compressors initialize first */
+3 -5
ipc/mqueue.c
··· 1269 1269 1270 1270 void mq_put_mnt(struct ipc_namespace *ns) 1271 1271 { 1272 - mntput(ns->mq_mnt); 1272 + kern_unmount(ns->mq_mnt); 1273 1273 } 1274 1274 1275 1275 static int __init init_mqueue_fs(void) ··· 1291 1291 1292 1292 spin_lock_init(&mq_lock); 1293 1293 1294 - init_ipc_ns.mq_mnt = kern_mount_data(&mqueue_fs_type, &init_ipc_ns); 1295 - if (IS_ERR(init_ipc_ns.mq_mnt)) { 1296 - error = PTR_ERR(init_ipc_ns.mq_mnt); 1294 + error = mq_init_ns(&init_ipc_ns); 1295 + if (error) 1297 1296 goto out_filesystem; 1298 - } 1299 1297 1300 1298 return 0; 1301 1299
-5
ipc/msgutil.c
··· 27 27 */ 28 28 struct ipc_namespace init_ipc_ns = { 29 29 .count = ATOMIC_INIT(1), 30 - #ifdef CONFIG_POSIX_MQUEUE 31 - .mq_queues_max = DFLT_QUEUESMAX, 32 - .mq_msg_max = DFLT_MSGMAX, 33 - .mq_msgsize_max = DFLT_MSGSIZEMAX, 34 - #endif 35 30 .user_ns = &init_user_ns, 36 31 }; 37 32