Subject: Re: hfsplus corrupts filesystems >2TB

From: Ben Hutchings <[email-masked]>
Date: Wed, 07 Oct 2009 03:37:18 +0100

This is my suggested change, so far only compile-tested:

--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -99,6 +99,10 @@
 
 	if (hfsplus_get_last_session(sb, &part_start, &part_size))
 		return -EINVAL;
+	if (part_start + part_size >= 0x100000000) {
+		pr_err("hfs: volumes larger than 2TB are not supported yet\n");
+		return -EINVAL;
+	}
 	while (1) {
 		bh = sb_bread512(sb, part_start + HFSPLUS_VOLHEAD_SECTOR, vhdr);
 		if (!bh)
--- END ---

Ben.

-- 
Ben Hutchings
To err is human; to really foul things up requires a computer.

---

From: dann frazier <[email-masked]>
Date: Wed, 7 Oct 2009 09:27:02 -0600

> +++ b/fs/hfsplus/wrapper.c

minor point, but maybe s/hfs/hfsplus/ ?

-- 
dann frazier

---

From: Ben Hutchings <[email-masked]>
Date: Wed, 07 Oct 2009 21:13:25 +0100

> minor point, but maybe s/hfs/hfsplus/ ?
[...]

This is consistent with other log messages from hfsplus.  While I think
the prefix *should* be "hfsplus: ", it seemed to me that it would be
worse to be inconsistent.  Also, the original HFS is intrinsically
limited to 2TB so this message is true for both of them.

Ben.