From 997cf9cc1d6bfa692bf4fb392fab6056df7ecb87 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Fri, 11 Jul 2008 19:27:31 -0400 Subject: [PATCH] --- yaml --- r: 101124 b: refs/heads/master c: e4079a11f5ed966b7d972cc69e8d337a0f095e32 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/ialloc.c | 6 +----- trunk/fs/ext4/super.c | 21 +++++++++++++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 7e36c9a8f18a..fa5eb728fa2e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c07651b556323e0e763c452587fe29d2b034b314 +refs/heads/master: e4079a11f5ed966b7d972cc69e8d337a0f095e32 diff --git a/trunk/fs/ext4/ialloc.c b/trunk/fs/ext4/ialloc.c index 8b0a10acd708..a92eb305344f 100644 --- a/trunk/fs/ext4/ialloc.c +++ b/trunk/fs/ext4/ialloc.c @@ -836,14 +836,10 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) goto fail_free_drop; if (test_opt(sb, EXTENTS)) { - /* set extent flag only for diretory, file and normal symlink*/ + /* set extent flag only for directory, file and normal symlink*/ if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) { EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL; ext4_ext_tree_init(handle, inode); - err = ext4_update_incompat_feature(handle, sb, - EXT4_FEATURE_INCOMPAT_EXTENTS); - if (err) - goto fail_free_drop; } } diff --git a/trunk/fs/ext4/super.c b/trunk/fs/ext4/super.c index 2bf9cdd7a036..1cb371dcd609 100644 --- a/trunk/fs/ext4/super.c +++ b/trunk/fs/ext4/super.c @@ -1324,6 +1324,13 @@ static int parse_options (char *options, struct super_block *sb, 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);