Subject: CONFIG_LBD has gone missing sometime after 2.6.18

From: Dan Dennison <[email-masked]>
Date: Wed, 7 Oct 2009 16:26:10 -0400

$ ls /boot/config*
/boot/config-2.6.18-6-amd64 /boot/config-2.6.29-2-amd64
/boot/config-2.6.26-1-amd64 /boot/config-2.6.30-1-amd64

$ grep LBD /boot/config*
/boot/config-2.6.18-6-amd64:CONFIG_LBD=y

Is it at all concerning that the sd driver tries a read capacity 16 and
fails?

I propose the following sequence of events:

1) 'sd' block device tries to read capacity 16 and fails because CONFIG_LBD
is not asserted, defaulting to a size of 2TB
2) 'hfsplus' then tries to mount this larger-than-2TB filesystem and is
successful
3) Writes to this inappropriately mounted filesystem fail once they run off
of the edge

I submit that the proposed patch is in error, and that hfsplus does very
well support >2TB filesystems on Linux. Further, hfsplus and all filesystem
drivers should check for the degenerate case of block device 

Dan Dennison

---

From: Dan Dennison <[email-masked]>
Date: Wed, 7 Oct 2009 17:10:03 -0400

FWIW, HFS Plus has a maximum size of (2^63 - 2^31) bytes, which is just shy
of 8EB.

http://support.apple.com/kb/HT2422
http://en.wikipedia.org/wiki/HFS_Plus

dan :)

---

From: Ben Hutchings <[email-masked]>
Date: Wed, 07 Oct 2009 23:02:40 +0100

> /boot/config-2.6.18-6-amd64:CONFIG_LBD=y

CONFIG_LBD is irrelevant on 64-bit architectures.

> Is it at all concerning that the sd driver tries a read capacity 16
> and fails?
> 
> 1) 'sd' block device tries to read capacity 16 and fails because
> CONFIG_LBD is not asserted, defaulting to a size of 2TB
> 2) 'hfsplus' then tries to mount this larger-than-2TB filesystem and
> is successful
> 3) Writes to this inappropriately mounted filesystem fail once they
> run off of the edge
> 
> I submit that the proposed patch is in error, and that hfsplus does
> very well support >2TB filesystems on Linux.
[...]

For starters, hfsplus_get_block() calculates a sector number using
32-bit values.  Even on 64-bit architectures.

Ben.

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

---

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

> http://en.wikipedia.org/wiki/HFS_Plus

I know.  I'm talking about the Linux implementation.

Ben.

---

From: Dan Dennison <[email-masked]>
Date: Wed, 7 Oct 2009 18:38:41 -0400

-----------------original message-----------------
From: "Ben Hutchings" [email-masked]
To: "Dan Dennison" [email-masked], [email-masked]
Date: Wed, 07 Oct 2009 23:02:40 +0100
-------------------------------------------------
> CONFIG_LBD is irrelevant on 64-bit architectures.

Good to know.

>> CONFIG_LBD is not asserted, defaulting to a size of 2TB

So _something_else_ is causing read capacity 16 to fail in this case.
Thoughts?

dan :)