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

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

Pull vfs fixes from Al Viro:
"Regression fix in mtdchar_open(), fix for a really old leak
(almost never hit in practice - it's a b0rken failure exit in
simple_fill_super()) and a typo fix in vfs.txt (misspelled
method type)."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
typo fix in Documentation/filesystems/vfs.txt
dentry leak in simple_fill_super() failure exit
fix breakage in mtdchar_open(), sanitize failure exits

+12 -11
+1 -1
Documentation/filesystems/vfs.txt
··· 114 114 struct file_system_type { 115 115 const char *name; 116 116 int fs_flags; 117 - struct dentry (*mount) (struct file_system_type *, int, 117 + struct dentry *(*mount) (struct file_system_type *, int, 118 118 const char *, void *); 119 119 void (*kill_sb) (struct super_block *); 120 120 struct module *owner;
+10 -10
drivers/mtd/mtdchar.c
··· 106 106 } 107 107 108 108 if (mtd->type == MTD_ABSENT) { 109 - put_mtd_device(mtd); 110 109 ret = -ENODEV; 111 - goto out; 110 + goto out1; 112 111 } 113 112 114 113 mtd_ino = iget_locked(mnt->mnt_sb, devnum); 115 114 if (!mtd_ino) { 116 - put_mtd_device(mtd); 117 115 ret = -ENOMEM; 118 - goto out; 116 + goto out1; 119 117 } 120 118 if (mtd_ino->i_state & I_NEW) { 121 119 mtd_ino->i_private = mtd; ··· 125 127 126 128 /* You can't open it RW if it's not a writeable device */ 127 129 if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) { 128 - iput(mtd_ino); 129 - put_mtd_device(mtd); 130 130 ret = -EACCES; 131 - goto out; 131 + goto out2; 132 132 } 133 133 134 134 mfi = kzalloc(sizeof(*mfi), GFP_KERNEL); 135 135 if (!mfi) { 136 - iput(mtd_ino); 137 - put_mtd_device(mtd); 138 136 ret = -ENOMEM; 139 - goto out; 137 + goto out2; 140 138 } 141 139 mfi->ino = mtd_ino; 142 140 mfi->mtd = mtd; 143 141 file->private_data = mfi; 142 + mutex_unlock(&mtd_mutex); 143 + return 0; 144 144 145 + out2: 146 + iput(mtd_ino); 147 + out1: 148 + put_mtd_device(mtd); 145 149 out: 146 150 mutex_unlock(&mtd_mutex); 147 151 simple_release_fs(&mnt, &count);
+1
fs/libfs.c
··· 529 529 return 0; 530 530 out: 531 531 d_genocide(root); 532 + shrink_dcache_parent(root); 532 533 dput(root); 533 534 return -ENOMEM; 534 535 }