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:
qnx4: don't leak ->BitMap on late failure exits
qnx4: reduce the insane nesting in qnx4_checkroot()
qnx4: di_fname is an array, for crying out loud...
vfs: remove printk from set_nlink()
wake up s_wait_unfrozen when ->freeze_fs fails

+27 -40
-3
fs/inode.c
··· 322 322 void set_nlink(struct inode *inode, unsigned int nlink) 323 323 { 324 324 if (!nlink) { 325 - printk_ratelimited(KERN_INFO 326 - "set_nlink() clearing i_nlink on %s inode %li\n", 327 - inode->i_sb->s_type->name, inode->i_ino); 328 325 clear_nlink(inode); 329 326 } else { 330 327 /* Yes, some filesystems do change nlink from zero to one */
+25 -37
fs/qnx4/inode.c
··· 179 179 struct qnx4_inode_entry *rootdir; 180 180 int rd, rl; 181 181 int i, j; 182 - int found = 0; 183 182 184 - if (*(qnx4_sb(sb)->sb->RootDir.di_fname) != '/') { 183 + if (*(qnx4_sb(sb)->sb->RootDir.di_fname) != '/') 185 184 return "no qnx4 filesystem (no root dir)."; 186 - } else { 187 - QNX4DEBUG((KERN_NOTICE "QNX4 filesystem found on dev %s.\n", sb->s_id)); 188 - rd = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_blk) - 1; 189 - rl = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_size); 190 - for (j = 0; j < rl; j++) { 191 - bh = sb_bread(sb, rd + j); /* root dir, first block */ 192 - if (bh == NULL) { 193 - return "unable to read root entry."; 194 - } 195 - for (i = 0; i < QNX4_INODES_PER_BLOCK; i++) { 196 - rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE); 197 - if (rootdir->di_fname != NULL) { 198 - QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname)); 199 - if (!strcmp(rootdir->di_fname, 200 - QNX4_BMNAME)) { 201 - found = 1; 202 - qnx4_sb(sb)->BitMap = kmemdup(rootdir, 203 - sizeof(struct qnx4_inode_entry), 204 - GFP_KERNEL); 205 - if (!qnx4_sb(sb)->BitMap) { 206 - brelse (bh); 207 - return "not enough memory for bitmap inode"; 208 - }/* keep bitmap inode known */ 209 - break; 210 - } 211 - } 212 - } 185 + QNX4DEBUG((KERN_NOTICE "QNX4 filesystem found on dev %s.\n", sb->s_id)); 186 + rd = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_blk) - 1; 187 + rl = le32_to_cpu(qnx4_sb(sb)->sb->RootDir.di_first_xtnt.xtnt_size); 188 + for (j = 0; j < rl; j++) { 189 + bh = sb_bread(sb, rd + j); /* root dir, first block */ 190 + if (bh == NULL) 191 + return "unable to read root entry."; 192 + rootdir = (struct qnx4_inode_entry *) bh->b_data; 193 + for (i = 0; i < QNX4_INODES_PER_BLOCK; i++, rootdir++) { 194 + QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname)); 195 + if (strcmp(rootdir->di_fname, QNX4_BMNAME) != 0) 196 + continue; 197 + qnx4_sb(sb)->BitMap = kmemdup(rootdir, 198 + sizeof(struct qnx4_inode_entry), 199 + GFP_KERNEL); 213 200 brelse(bh); 214 - if (found != 0) { 215 - break; 216 - } 201 + if (!qnx4_sb(sb)->BitMap) 202 + return "not enough memory for bitmap inode"; 203 + /* keep bitmap inode known */ 204 + return NULL; 217 205 } 218 - if (found == 0) { 219 - return "bitmap file not found."; 220 - } 206 + brelse(bh); 221 207 } 222 - return NULL; 208 + return "bitmap file not found."; 223 209 } 224 210 225 211 static int qnx4_fill_super(struct super_block *s, void *data, int silent) ··· 256 270 if (IS_ERR(root)) { 257 271 printk(KERN_ERR "qnx4: get inode failed\n"); 258 272 ret = PTR_ERR(root); 259 - goto out; 273 + goto outb; 260 274 } 261 275 262 276 ret = -ENOMEM; ··· 269 283 270 284 outi: 271 285 iput(root); 286 + outb: 287 + kfree(qs->BitMap); 272 288 out: 273 289 brelse(bh); 274 290 outnobh:
+2
fs/super.c
··· 1186 1186 printk(KERN_ERR 1187 1187 "VFS:Filesystem freeze failed\n"); 1188 1188 sb->s_frozen = SB_UNFROZEN; 1189 + smp_wmb(); 1190 + wake_up(&sb->s_wait_unfrozen); 1189 1191 deactivate_locked_super(sb); 1190 1192 return ret; 1191 1193 }