Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273237
b: refs/heads/master
c: 434a964
h: refs/heads/master
i:
  273235: fa141bc
v: v3
  • Loading branch information
Phillip Lougher authored and Linus Torvalds committed Nov 2, 2011
1 parent fcee996 commit a5a2f17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3069083cc8def2ffad8520f0f24c6f95f140aac5
refs/heads/master: 434a964daa14b9db083ce20404a4a2add54d037a
20 changes: 15 additions & 5 deletions trunk/fs/hfs/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,26 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
case HFS_EXT_CNID:
hfs_inode_read_fork(tree->inode, mdb->drXTExtRec, mdb->drXTFlSize,
mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
if (HFS_I(tree->inode)->alloc_blocks >
HFS_I(tree->inode)->first_blocks) {
printk(KERN_ERR "hfs: invalid btree extent records\n");
unlock_new_inode(tree->inode);
goto free_inode;
}

tree->inode->i_mapping->a_ops = &hfs_btree_aops;
break;
case HFS_CAT_CNID:
hfs_inode_read_fork(tree->inode, mdb->drCTExtRec, mdb->drCTFlSize,
mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz));

if (!HFS_I(tree->inode)->first_blocks) {
printk(KERN_ERR "hfs: invalid btree extent records "
"(0 size).\n");
unlock_new_inode(tree->inode);
goto free_inode;
}

tree->inode->i_mapping->a_ops = &hfs_btree_aops;
break;
default:
Expand All @@ -59,11 +74,6 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
}
unlock_new_inode(tree->inode);

if (!HFS_I(tree->inode)->first_blocks) {
printk(KERN_ERR "hfs: invalid btree extent records (0 size).\n");
goto free_inode;
}

mapping = tree->inode->i_mapping;
page = read_mapping_page(mapping, 0, NULL);
if (IS_ERR(page))
Expand Down

0 comments on commit a5a2f17

Please sign in to comment.