Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29708
b: refs/heads/master
c: fcd5df3
h: refs/heads/master
v: v3
  • Loading branch information
Mingming Cao authored and Linus Torvalds committed Jun 25, 2006
1 parent b5d013f commit f0a333c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b61367732fc273977cc3fb85c272ce1a7bb1f533
refs/heads/master: fcd5df35882b128ef3e160fab3074e6fe7ae501b
10 changes: 10 additions & 0 deletions trunk/fs/ext3/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,16 @@ int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es,
if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
return 0;

if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
printk(KERN_ERR "EXT3-fs: filesystem on %s:"
" too large to resize to %lu blocks safely\n",
sb->s_id, n_blocks_count);
if (sizeof(sector_t) < 8)
ext3_warning(sb, __FUNCTION__,
"CONFIG_LBD not enabled\n");
return -EINVAL;
}

if (n_blocks_count < o_blocks_count) {
ext3_warning(sb, __FUNCTION__,
"can't shrink FS - resize aborted");
Expand Down
10 changes: 10 additions & 0 deletions trunk/fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,16 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
goto failed_mount;
}

if (le32_to_cpu(es->s_blocks_count) >
(sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
printk(KERN_ERR "EXT3-fs: filesystem on %s:"
" too large to mount safely\n", sb->s_id);
if (sizeof(sector_t) < 8)
printk(KERN_WARNING "EXT3-fs: CONFIG_LBD not "
"enabled\n");
goto failed_mount;
}

if (EXT3_BLOCKS_PER_GROUP(sb) == 0)
goto cantfind_ext3;
sbi->s_groups_count = (le32_to_cpu(es->s_blocks_count) -
Expand Down

0 comments on commit f0a333c

Please sign in to comment.