Whamcloud - gitweb
b=17569 add check in ext3-based ldiskfs for >8TB filesystems
authorRahul Deshmukh <Rahul.Deshmukh@sun.com>
Wed, 16 Jun 2010 06:51:43 +0000 (12:21 +0530)
committerRobert Read <robert.read@oracle.com>
Thu, 17 Jun 2010 06:01:32 +0000 (23:01 -0700)
i=johann

This is combined patch which includes both patches on bug 17569 which needs to
be landed.
1. remove force option for rhel5/ext4
2. add 16TB limit mount option for rhel5/ext4

ldiskfs/kernel_patches/patches/ext4-extents-mount-option-rhel5.patch
ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch [deleted file]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series

index 96e964b..cb0bcf0 100644 (file)
@@ -93,7 +93,7 @@ diff -up linux-2.6.18-164/fs/ext4/super.c linux-2.6.18-164/fs/ext4/super.c
 @@ -1334,6 +1336,7 @@ enum {
        Opt_inode_readahead_blks, Opt_journal_ioprio,
        Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_bigendian_extents,
-       Opt_force_over_8tb,
+       Opt_force_over_16tb,
 +      Opt_extents, Opt_noextents,
  };
  
@@ -101,7 +101,7 @@ diff -up linux-2.6.18-164/fs/ext4/super.c linux-2.6.18-164/fs/ext4/super.c
 @@ -1401,6 +1404,8 @@ static match_table_t tokens = {
        {Opt_noauto_da_alloc, "noauto_da_alloc"},
        {Opt_bigendian_extents, "bigendian_extents"},
-       {Opt_force_over_8tb, "force_over_8tb"},
+       {Opt_force_over_16tb, "force_over_16tb"},
 +      {Opt_extents, "extents"},
 +      {Opt_noextents, "noextents"},
        {Opt_err, NULL},
@@ -116,8 +116,8 @@ diff -up linux-2.6.18-164/fs/ext4/super.c linux-2.6.18-164/fs/ext4/super.c
        if (!options)
                return 1;
 @@ -1829,6 +1835,33 @@ set_qf_format:
-               case Opt_force_over_8tb:
-                       force_over_8tb = 1;
+               case Opt_force_over_16tb:
+                       force_over_16tb = 1;
                        break;
 +              case Opt_extents:
 +                      if (!EXT4_HAS_INCOMPAT_FEATURE(sb,
diff --git a/ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch
new file mode 100644 (file)
index 0000000..4ea9b24
--- /dev/null
@@ -0,0 +1,56 @@
+Index: linux-2.6.18-164.6.1/fs/ext4/super.c
+===================================================================
+--- linux-2.6.18-164.6.1.orig/fs/ext4/super.c
++++ linux-2.6.18-164.6.1/fs/ext4/super.c
+@@ -51,6 +51,8 @@
+ struct proc_dir_entry *ext4_proc_root;
++static int force_over_16tb;
++
+ static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
+                            unsigned long journal_devnum);
+ static int ext4_commit_super(struct super_block *sb,
+@@ -1343,6 +1345,7 @@ enum {
+       Opt_stripe, Opt_delalloc, Opt_nodelalloc,
+       Opt_inode_readahead_blks, Opt_journal_ioprio,
+       Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_bigendian_extents,
++      Opt_force_over_16tb,
+ };
+ static match_table_t tokens = {
+@@ -1410,6 +1413,7 @@ static match_table_t tokens = {
+       {Opt_auto_da_alloc, "auto_da_alloc"},
+       {Opt_noauto_da_alloc, "noauto_da_alloc"},
+       {Opt_bigendian_extents, "bigendian_extents"},
++      {Opt_force_over_16tb, "force_over_16tb"},
+       {Opt_err, NULL},
+ };
+@@ -1837,6 +1841,9 @@ set_qf_format:
+                       break;
+               case Opt_mballoc:
+                       break;
++              case Opt_force_over_16tb:
++                      force_over_16tb = 1;
++                      break;
+               default:
+                       printk(KERN_ERR
+                              "EXT4-fs: Unrecognized mount option \"%s\" "
+@@ -2692,6 +2699,16 @@ static int ext4_fill_super(struct super_
+               goto failed_mount;
+       }
++      if (ext4_blocks_count(es) >= (1ULL << 32)) {
++              if (force_over_16tb == 0) {
++                      printk(KERN_ERR "EXT4-fs does not support filesystems "
++                             "greater than 16TB and can cause data corruption."
++                             "Use \"force_over_16tb\" mount option to override."
++                             "\n");
++                      goto failed_mount;
++              }
++      }
++
+       if (EXT4_BLOCKS_PER_GROUP(sb) == 0)
+               goto cantfind_ext4;
diff --git a/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch
deleted file mode 100644 (file)
index 6529fbc..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-Index: linux-2.6.18-128.1.6/fs/ext4/super.c
-===================================================================
---- linux-2.6.18-128.1.6.orig/fs/ext4/super.c
-+++ linux-2.6.18-128.1.6/fs/ext4/super.c
-@@ -47,6 +47,8 @@
- #include "namei.h"
- #include "group.h"
-+static int force_over_8tb;
-+
- static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
-                            unsigned long journal_devnum);
- static int ext4_create_journal(struct super_block *, struct ext4_super_block *,
-@@ -1227,6 +1229,7 @@ enum {
-       Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
-       Opt_mballoc, Opt_nomballoc, Opt_stripe,
-       Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_bigendian_extents,
-+      Opt_force_over_8tb,
- };
- static match_table_t tokens = {
-@@ -1289,6 +1292,7 @@ static match_table_t tokens = {
-       {Opt_stripe, "stripe=%u"},
-       {Opt_resize, "resize"},
-       {Opt_bigendian_extents, "bigendian_extents"},
-+      {Opt_force_over_8tb, "force_over_8tb"},
-       {Opt_err, NULL},
- };
-@@ -1690,6 +1694,9 @@ clear_qf_name:
-               case Opt_bigendian_extents:
-                       bigendian_extents = 1;
-                       break;
-+              case Opt_force_over_8tb:
-+                      force_over_8tb = 1;
-+                      break;
-               default:
-                       printk(KERN_ERR
-                              "EXT4-fs: Unrecognized mount option \"%s\" "
-@@ -2534,6 +2541,17 @@ static int ext4_fill_super(struct super_
-               goto failed_mount;
-       }
-+      if (ext4_blocks_count(es) >
-+          ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) {
-+              if (force_over_8tb == 0) {
-+                      printk(KERN_ERR "EXT4-fs does not support filesystems "
-+                             "greater than 8TB and can cause data corruption."
-+                             "Use \"force_over_8tb\" mount option to override."
-+                             "\n");
-+                      goto failed_mount;
-+              }
-+      }
-+
-       if (EXT4_BLOCKS_PER_GROUP(sb) == 0)
-               goto cantfind_ext4;
index b24c812..ecc6b6c 100644 (file)
@@ -18,7 +18,7 @@ ext4-big-endian-check-2.6-rhel5.patch
 ext4-alloc-policy-2.6-rhel5.patch
 ext4-misc-rhel5.patch
 ext4-convert-group-lock-rhel5.patch
-ext4-force_over_8tb-rhel5.patch
+ext4-force_over_16tb-rhel5.patch
 ext4-pdir-fix.patch
 ext4-osd-iop-common.patch
 ext4-osd-iam-exports.patch