VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christoph Hellwig <hch@tuxera.com> 2010-10-14 09:54:23 -0400 committer: Christoph Hellwig <hch@lst.de> 2010-10-14 09:54:23 -0400 commit: 13571a6977f821fab7d9c3cc5f75da52b7732e40 parent: 9250f925972d03ccc0c0a4dd4e9b794d2ef6d52b
Commit Summary:
hfsplus: validate btree flags
Diffstat:
1 file changed, 5 insertions, 14 deletions
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
index 790cd6a8605d..2f39d05443e1 100644
--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -42,20 +42,12 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
 		recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2);
 		if (!recoff)
 			return 0;
-		if (node->tree->attributes & HFS_TREE_BIGKEYS) {
-			retval = hfs_bnode_read_u16(node, recoff) + 2;
-			if (retval > node->tree->max_key_len + 2) {
-				printk(KERN_ERR "hfs: keylen %d too large\n",
-					retval);
-				retval = 0;
-			}
-		} else {
-			retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
-			if (retval > node->tree->max_key_len + 1) {
-				printk(KERN_ERR "hfs: keylen %d too large\n",
-					retval);
-				retval = 0;
-			}
+
+		retval = hfs_bnode_read_u16(node, recoff) + 2;
+		if (retval > node->tree->max_key_len + 2) {
+			printk(KERN_ERR "hfs: keylen %d too large\n",
+				retval);
+			retval = 0;
 		}
 	}
 	return retval;