提交 c07651b5 编写于 作者: A Aneesh Kumar K.V 提交者: Theodore Ts'o

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: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: NMingming Cao <cmm@us.ibm.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 dd919b98
......@@ -1004,6 +1004,7 @@ static int parse_options (char *options, struct super_block *sb,
int qtype, qfmt;
char *qname;
#endif
ext4_fsblk_t last_block;
if (!options)
return 1;
......@@ -1326,6 +1327,20 @@ static int parse_options (char *options, struct super_block *sb,
set_opt (sbi->s_mount_opt, EXTENTS);
break;
case Opt_noextents:
/*
* When e2fsprogs support resizing an already existing
* ext3 file system to greater than 2**32 we need to
* add support to block allocator to handle growing
* already existing block mapped inode so that blocks
* allocated for them fall within 2**32
*/
last_block = ext4_blocks_count(sbi->s_es) - 1;
if (last_block > 0xffffffffULL) {
printk(KERN_ERR "EXT4-fs: Filesystem too "
"large to mount with "
"-o noextents options\n");
return 0;
}
clear_opt (sbi->s_mount_opt, EXTENTS);
break;
case Opt_i_version:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册