]> err.no Git - linux-2.6/blobdiff - fs/ext4/super.c
Merge branch 'timers/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6] / fs / ext4 / super.c
index 4e104dd0ec212124b42da43c5ae08ebe62f663f7..1cb371dcd609aae5f115cf236acd4d0c66956efb 100644 (file)
@@ -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;
@@ -1323,9 +1324,30 @@ set_qf_format:
                        clear_opt(sbi->s_mount_opt, NOBH);
                        break;
                case Opt_extents:
+                       if (!EXT4_HAS_INCOMPAT_FEATURE(sb,
+                                       EXT4_FEATURE_INCOMPAT_EXTENTS)) {
+                               ext4_warning(sb, __func__,
+                                       "extents feature not enabled "
+                                       "on this filesystem, use tune2fs\n");
+                               return 0;
+                       }
                        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:
@@ -1982,12 +2004,18 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
 
        /*
         * turn on extents feature by default in ext4 filesystem
-        * User -o noextents to turn it off
+        * only if feature flag already set by mkfs or tune2fs.
+        * Use -o noextents to turn it off
         */
-       set_opt(sbi->s_mount_opt, EXTENTS);
+       if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS))
+               set_opt(sbi->s_mount_opt, EXTENTS);
+       else
+               ext4_warning(sb, __func__,
+                       "extents feature not enabled on this filesystem, "
+                       "use tune2fs.\n");
        /*
-        * turn on mballoc feature by default in ext4 filesystem
-        * User -o nomballoc to turn it off
+        * turn on mballoc code by default in ext4 filesystem
+        * Use -o nomballoc to turn it off
         */
        set_opt(sbi->s_mount_opt, MBALLOC);