aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs/brec.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2008-02-06 04:37:10 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:05 -0500
commit55581d018ed3493d226e7a4d645d9c8a5af6c36b (patch)
treed687d90390073aeb0bda273b7b9f051a36f5d892 /fs/hfs/brec.c
parent7c28cbaed6811260efc0134b984b924cd0ed46f5 (diff)
address hfs on-disk corruption robustness review comments
Address Roman's review comments for the previously sent on-disk corruption hfs robustness patch. - use 0 as a failure value, rather than making a new macro HFS_BAD_KEYLEN, and use a switch statement instead of if's. - Add new fail: target to __hfs_brec_find to skip assignments using bad values when exiting with a failure. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Eric Sandeen <sandeen@redhat.com> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hfs/brec.c')
-rw-r--r--fs/hfs/brec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c
index 8626ee375ea8..878bf25dbc6a 100644
--- a/fs/hfs/brec.c
+++ b/fs/hfs/brec.c
@@ -49,14 +49,14 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
49 if (retval > node->tree->max_key_len + 2) { 49 if (retval > node->tree->max_key_len + 2) {
50 printk(KERN_ERR "hfs: keylen %d too large\n", 50 printk(KERN_ERR "hfs: keylen %d too large\n",
51 retval); 51 retval);
52 retval = HFS_BAD_KEYLEN; 52 retval = 0;
53 } 53 }
54 } else { 54 } else {
55 retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1; 55 retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
56 if (retval > node->tree->max_key_len + 1) { 56 if (retval > node->tree->max_key_len + 1) {
57 printk(KERN_ERR "hfs: keylen %d too large\n", 57 printk(KERN_ERR "hfs: keylen %d too large\n",
58 retval); 58 retval);
59 retval = HFS_BAD_KEYLEN; 59 retval = 0;
60 } 60 }
61 } 61 }
62 } 62 }