]> Pileus Git - ~andy/linux/blobdiff - fs/ext4/super.c
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[~andy/linux] / fs / ext4 / super.c
index 2bf9cdd7a0365adea61531d804794fb8a58921bd..b5479b1dff14b7513b077ddc2c920ceffc67b76d 100644 (file)
@@ -595,7 +595,7 @@ static void ext4_destroy_inode(struct inode *inode)
        kmem_cache_free(ext4_inode_cachep, EXT4_I(inode));
 }
 
-static void init_once(struct kmem_cache *cachep, void *foo)
+static void init_once(void *foo)
 {
        struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
 
@@ -1324,6 +1324,13 @@ 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:
@@ -1997,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);