diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2008-07-11 19:27:31 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-11 19:27:31 -0400 |
commit | c07651b556323e0e763c452587fe29d2b034b314 (patch) | |
tree | 6cae1d3c9a63e1a5ba83639003af792591845347 /fs/ext4 | |
parent | dd919b9822c5fd9fd72f95a602440130297c3857 (diff) |
ext4: Don't allow nonextenst mount option for large filesystem
The block mapped inode format can address only blocks within 2**32. This
causes a number of issues, the biggest of which is that the block
allocator needs to be taught that certain inodes can not utilize block
numbers > 2**32. So until this is fixed, it is simplest to fail
mounting of file systems with more than 2**32 blocks if the -o noextents
option is given.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 4e104dd0ec21..2bf9cdd7a036 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1004,6 +1004,7 @@ static int parse_options (char *options, struct super_block *sb, | |||
1004 | int qtype, qfmt; | 1004 | int qtype, qfmt; |
1005 | char *qname; | 1005 | char *qname; |
1006 | #endif | 1006 | #endif |
1007 | ext4_fsblk_t last_block; | ||
1007 | 1008 | ||
1008 | if (!options) | 1009 | if (!options) |
1009 | return 1; | 1010 | return 1; |
@@ -1326,6 +1327,20 @@ set_qf_format: | |||
1326 | set_opt (sbi->s_mount_opt, EXTENTS); | 1327 | set_opt (sbi->s_mount_opt, EXTENTS); |
1327 | break; | 1328 | break; |
1328 | case Opt_noextents: | 1329 | case Opt_noextents: |
1330 | /* | ||
1331 | * When e2fsprogs support resizing an already existing | ||
1332 | * ext3 file system to greater than 2**32 we need to | ||
1333 | * add support to block allocator to handle growing | ||
1334 | * already existing block mapped inode so that blocks | ||
1335 | * allocated for them fall within 2**32 | ||
1336 | */ | ||
1337 | last_block = ext4_blocks_count(sbi->s_es) - 1; | ||
1338 | if (last_block > 0xffffffffULL) { | ||
1339 | printk(KERN_ERR "EXT4-fs: Filesystem too " | ||
1340 | "large to mount with " | ||
1341 | "-o noextents options\n"); | ||
1342 | return 0; | ||
1343 | } | ||
1329 | clear_opt (sbi->s_mount_opt, EXTENTS); | 1344 | clear_opt (sbi->s_mount_opt, EXTENTS); |
1330 | break; | 1345 | break; |
1331 | case Opt_i_version: | 1346 | case Opt_i_version: |