aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs/btree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfs/btree.c')
-rw-r--r--fs/hfs/btree.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 110dd3515dc8..24cf6fc43021 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -81,15 +81,23 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
81 goto fail_page; 81 goto fail_page;
82 if (!tree->node_count) 82 if (!tree->node_count)
83 goto fail_page; 83 goto fail_page;
84 if ((id == HFS_EXT_CNID) && (tree->max_key_len != HFS_MAX_EXT_KEYLEN)) { 84 switch (id) {
85 printk(KERN_ERR "hfs: invalid extent max_key_len %d\n", 85 case HFS_EXT_CNID:
86 tree->max_key_len); 86 if (tree->max_key_len != HFS_MAX_EXT_KEYLEN) {
87 goto fail_page; 87 printk(KERN_ERR "hfs: invalid extent max_key_len %d\n",
88 } 88 tree->max_key_len);
89 if ((id == HFS_CAT_CNID) && (tree->max_key_len != HFS_MAX_CAT_KEYLEN)) { 89 goto fail_page;
90 printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n", 90 }
91 tree->max_key_len); 91 break;
92 goto fail_page; 92 case HFS_CAT_CNID:
93 if (tree->max_key_len != HFS_MAX_CAT_KEYLEN) {
94 printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n",
95 tree->max_key_len);
96 goto fail_page;
97 }
98 break;
99 default:
100 BUG();
93 } 101 }
94 102
95 tree->node_size_shift = ffs(size) - 1; 103 tree->node_size_shift = ffs(size) - 1;