]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Avoid disk sector_t overflow for >2TB ext3 filesystem
authorMingming Cao <cmm@us.ibm.com>
Sun, 25 Jun 2006 12:47:50 +0000 (05:47 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 25 Jun 2006 17:01:07 +0000 (10:01 -0700)
commitdae677ab202c3c1793963585ff6911378e0d9060
tree2ffa30054f510e0fdca988d18ab28d6df12c3f06
parent67cb70a571211631c8b128a0bc46d2d3be37bccd
[PATCH] Avoid disk sector_t overflow for >2TB ext3 filesystem

If ext3 filesystem is larger than 2TB, and sector_t is a u32 (i.e.
CONFIG_LBD not defined in the kernel), the calculation of the disk sector
will overflow.  Add check at ext3_fill_super() and ext3_group_extend() to
prevent mount/remount/resize >2TB ext3 filesystem if sector_t size is 4
bytes.

Verified this patch on a 32 bit platform without CONFIG_LBD defined
(sector_t is 32 bits long), mount refuse to mount a 10TB ext3.

Signed-off-by: Mingming Cao<cmm@us.ibm.com>
Acked-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ext3/resize.c
fs/ext3/super.c