Commit 9a57bb39 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hfsplus: fix key length for index nodes

From: Roman Zippel <zippel@linux-m68k.org>

Use the correct key length for index nodes.
parent e00d79e4
......@@ -33,7 +33,7 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
if ((node->type == HFS_NODE_INDEX) &&
!(node->tree->attributes & HFS_TREE_VARIDXKEYS)) {
retval = node->tree->max_key_len;
retval = node->tree->max_key_len + 2;
} else {
recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2);
if (!recoff)
......@@ -144,7 +144,7 @@ int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len)
if (tree->attributes & HFS_TREE_VARIDXKEYS)
key_len = be16_to_cpu(fd->search_key->key_len) + 2;
else {
fd->search_key->key_len = tree->max_key_len;
fd->search_key->key_len = cpu_to_be16(tree->max_key_len);
key_len = tree->max_key_len + 2;
}
goto again;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment