summaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@tuxera.com>2011-02-16 09:34:26 +0100
committerChristoph Hellwig <hch@lst.de>2011-06-30 13:40:59 +0200
commitc6d5f5fa658f2569a7baaff5acda261a1316cee9 (patch)
tree1e7e03558a9229e8fc3aaec450ffa8049a08c96b /fs/hfsplus/super.c
parent4ba2d5fdcfd19de0dedf394ddc48db2f219fa89a (diff)
downloadlinux-c6d5f5fa658f2569a7baaff5acda261a1316cee9.tar.gz
linux-c6d5f5fa658f2569a7baaff5acda261a1316cee9.tar.bz2
linux-c6d5f5fa658f2569a7baaff5acda261a1316cee9.zip
hfsplus: lift the 2TB size limit
Replace the hardcoded 2TB limit with a dynamic limit based on the block size now that we have fixed the few overflows preventing operation with large volumes. Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r--fs/hfsplus/super.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 84a47b709f51..acaef57e3606 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -393,6 +393,13 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
if (!sbi->rsrc_clump_blocks)
sbi->rsrc_clump_blocks = 1;
+ err = generic_check_addressable(sbi->alloc_blksz_shift,
+ sbi->total_blocks);
+ if (err) {
+ printk(KERN_ERR "hfs: filesystem size too large.\n");
+ goto out_free_vhdr;
+ }
+
/* Set up operations so we can load metadata */
sb->s_op = &hfsplus_sops;
sb->s_maxbytes = MAX_LFS_FILESIZE;
@@ -417,6 +424,8 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
sb->s_flags |= MS_RDONLY;
}
+ err = -EINVAL;
+
/* Load metadata objects (B*Trees) */
sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
if (!sbi->ext_tree) {