From: Cliff White Date: Tue, 19 Jan 2010 19:54:20 +0000 (-0800) Subject: b=19673 Add ldiskfs maxdirsize mount option X-Git-Tag: 1.10.0.35~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b8487347aae169cb5547e66038c96b0abd094104 b=19673 Add ldiskfs maxdirsize mount option i=girish.shilamkar i=johann --- diff --git a/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-rhel5.patch b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-rhel5.patch index 30c5ce0..913b02c 100644 --- a/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-rhel5.patch +++ b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-rhel5.patch @@ -17,7 +17,7 @@ Index: linux-2.6.18-92.1.6/fs/ext3/super.c Opt_grpquota, - Opt_extents, Opt_noextents, Opt_extdebug, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, - Opt_mballoc, Opt_nomballoc, Opt_stripe, + Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize }; @@ -766,6 +768,7 @@ static match_table_t tokens = { diff --git a/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-sles10.patch index 2ac0aee..722b752 100644 --- a/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-sles10.patch +++ b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-sles10.patch @@ -11,43 +11,44 @@ Index: linux-2.6.16.60-0.27/fs/ext3/super.c /* * The only special thing we need to do here is to make sure that all * journal_stop calls result in the superblock being marked dirty, so -@@ -703,7 +705,7 @@ enum { - Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, +@@ -705,7 +707,7 @@ enum { Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_grpquota, - Opt_extents, Opt_noextents, Opt_extdebug, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, - Opt_mballoc, Opt_nomballoc, Opt_stripe, - Opt_grpquota + Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize }; -@@ -762,6 +764,7 @@ static match_table_t tokens = { - {Opt_iopen_nopriv, "iopen_nopriv"}, + +@@ -764,6 +766,7 @@ static match_table_t tokens = { + {Opt_barrier, "barrier=%u"}, {Opt_extents, "extents"}, {Opt_noextents, "noextents"}, + {Opt_bigendian_extents, "bigendian_extents"}, {Opt_extdebug, "extdebug"}, - {Opt_barrier, "barrier=%u"}, {Opt_mballoc, "mballoc"}, -@@ -1122,6 +1125,9 @@ clear_qf_name: + {Opt_nomballoc, "nomballoc"}, +@@ -1124,6 +1127,10 @@ clear_qf_name: case Opt_noextents: clear_opt (sbi->s_mount_opt, EXTENTS); break; + case Opt_bigendian_extents: + bigendian_extents = 1; + break; ++ case Opt_extdebug: set_opt (sbi->s_mount_opt, EXTDEBUG); break; -@@ -2052,6 +2058,16 @@ static int ext3_fill_super (struct super +@@ -2087,6 +2094,16 @@ static int ext3_fill_super (struct super NULL, 0)) goto failed_mount; +#ifdef __BIG_ENDIAN + if (bigendian_extents == 0) { + printk(KERN_ERR "EXT3-fs: e2fsck is not guaranteed to work " -+ "correctly on the filesystem if EXTENTS feature is " -+ "used on big-endian systems. Use \"bigendian_extents\" " -+ "mount option to override.\n"); ++ "correctly on the filesystem if EXTENTS feature is " ++ "used on big-endian systems. Use \"bigendian_extents\" " ++ "mount option to override.\n"); + goto failed_mount; + } +#endif diff --git a/ldiskfs/kernel_patches/patches/ext3-extents-2.6.16-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-extents-2.6.16-sles10.patch index a42a680..f68ced2 100644 --- a/ldiskfs/kernel_patches/patches/ext3-extents-2.6.16-sles10.patch +++ b/ldiskfs/kernel_patches/patches/ext3-extents-2.6.16-sles10.patch @@ -2433,18 +2433,19 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/super.c Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, +- Opt_grpquota ++ Opt_grpquota, + Opt_extents, Opt_noextents, Opt_extdebug, - Opt_grpquota }; @@ -729,6 +733,9 @@ static match_table_t tokens = { {Opt_iopen, "iopen"}, {Opt_noiopen, "noiopen"}, {Opt_iopen_nopriv, "iopen_nopriv"}, + {Opt_barrier, "barrier=%u"}, + {Opt_extents, "extents"}, + {Opt_noextents, "noextents"}, + {Opt_extdebug, "extdebug"}, - {Opt_barrier, "barrier=%u"}, {Opt_err, NULL}, {Opt_resize, "resize"}, @@ -1070,6 +1077,15 @@ clear_qf_name: @@ -2463,11 +2464,12 @@ Index: linux-2.6.16.54-0.2.5/fs/ext3/super.c default: printk (KERN_ERR "EXT3-fs: Unrecognized mount option \"%s\" " -@@ -1800,6 +1816,7 @@ static int ext3_fill_super (struct super +@@ -1800,6 +1816,8 @@ static int ext3_fill_super (struct super percpu_counter_mod(&sbi->s_dirs_counter, ext3_count_dirs(sb)); + ext3_ext_init(sb); ++ lock_kernel(); return 0; diff --git a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch index c46c472..1e1ac08 100644 --- a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch +++ b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch @@ -15,22 +15,21 @@ Index: linux-2.6.18-128.1.6/fs/ext3/super.c Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_grpquota, Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, -- Opt_mballoc, Opt_nomballoc, Opt_stripe, -+ Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_force_over_8tb, +- Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize ++ Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize, Opt_force_over_8tb, }; static match_table_t tokens = { -@@ -779,6 +781,7 @@ static match_table_t tokens = { +@@ -779,5 +781,6 @@ static match_table_t tokens = { {Opt_mballoc, "mballoc"}, {Opt_nomballoc, "nomballoc"}, {Opt_stripe, "stripe=%u"}, + {Opt_force_over_8tb, "force_over_8tb"}, - {Opt_err, NULL}, {Opt_resize, "resize"}, }; @@ -1157,6 +1160,9 @@ clear_qf_name: return 0; - sbi->s_stripe = option; + sbi->s_max_dir_size = option; break; + case Opt_force_over_8tb: + force_over_8tb = 1; diff --git a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch index ff5e907..ef31103 100644 --- a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch +++ b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch @@ -11,26 +11,26 @@ Index: linux-2.6.16.60-0.37/fs/ext3/super.c static int ext3_load_journal(struct super_block *, struct ext3_super_block *, unsigned long journal_devnum); static int ext3_create_journal(struct super_block *, struct ext3_super_block *, -@@ -708,7 +710,7 @@ enum { +@@ -710,7 +710,7 @@ enum { Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_grpquota, Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, - Opt_mballoc, Opt_nomballoc, Opt_stripe, -- Opt_grpquota -+ Opt_grpquota, Opt_force_over_8tb +- Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize ++ Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize, Opt_force_over_8tb, }; static match_table_t tokens = { -@@ -771,6 +773,7 @@ static match_table_t tokens = { +@@ -773,6 +773,7 @@ static match_table_t tokens = { {Opt_mballoc, "mballoc"}, {Opt_nomballoc, "nomballoc"}, {Opt_stripe, "stripe=%u"}, + {Opt_force_over_8tb, "force_over_8tb"}, - {Opt_err, NULL}, {Opt_resize, "resize"}, - }; -@@ -1145,6 +1148,9 @@ clear_qf_name: + {Opt_maxdirsize, "maxdirsize=%u"}, + {Opt_err, NULL} +@@ -1156,6 +1157,9 @@ clear_qf_name: return 0; - sbi->s_stripe = option; + sbi->s_max_dir_size = option; break; + case Opt_force_over_8tb: + force_over_8tb = 1; @@ -38,17 +38,17 @@ Index: linux-2.6.16.60-0.37/fs/ext3/super.c default: printk (KERN_ERR "EXT3-fs: Unrecognized mount option \"%s\" " -@@ -2231,6 +2237,17 @@ static int ext3_fill_super (struct super +@@ -2242,6 +2246,17 @@ static int ext3_fill_super (struct super goto failed_mount; } -+ if (le32_to_cpu(es->s_blocks_count) > ++ if (le32_to_cpu(es->s_blocks_count) > + ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) { + if (force_over_8tb == 0) { + printk(KERN_ERR "EXT3-fs does not support filesystems " -+ "greater than 8TB and can cause data corruption." -+ "Use \"force_over_8tb\" mount option to override." -+ "\n"); ++ "greater than 8TB and can cause data corruption." ++ "Use \"force_over_8tb\" mount option to override." ++ "\n"); + goto failed_mount; + } + } diff --git a/ldiskfs/kernel_patches/patches/ext3-max-dir-size.patch b/ldiskfs/kernel_patches/patches/ext3-max-dir-size.patch index 97f69cc..3d901eb 100644 --- a/ldiskfs/kernel_patches/patches/ext3-max-dir-size.patch +++ b/ldiskfs/kernel_patches/patches/ext3-max-dir-size.patch @@ -1,8 +1,8 @@ -Index: linux-2.6.18-92.1.17/fs/ext3/ialloc.c +Index: linux-stage/fs/ext3/ialloc.c =================================================================== ---- linux-2.6.18-92.1.17.orig/fs/ext3/ialloc.c -+++ linux-2.6.18-92.1.17/fs/ext3/ialloc.c -@@ -521,12 +521,15 @@ struct inode *ext3_new_inode(handle_t *h +--- linux-stage.orig/fs/ext3/ialloc.c ++++ linux-stage/fs/ext3/ialloc.c +@@ -521,12 +521,15 @@ struct inode *ext3_new_inode(handle_t return ERR_PTR(-EPERM); sb = dir->i_sb; @@ -19,10 +19,10 @@ Index: linux-2.6.18-92.1.17/fs/ext3/ialloc.c es = sbi->s_es; if (goal) { group = (goal - 1) / EXT3_INODES_PER_GROUP(sb); -Index: linux-2.6.18-92.1.17/fs/ext3/super.c +Index: linux-stage/fs/ext3/super.c =================================================================== ---- linux-2.6.18-92.1.17.orig/fs/ext3/super.c -+++ linux-2.6.18-92.1.17/fs/ext3/super.c +--- linux-stage.orig/fs/ext3/super.c ++++ linux-stage/fs/ext3/super.c @@ -45,6 +45,12 @@ #include "namei.h" #include "group.h" @@ -36,7 +36,7 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c static int ext3_load_journal(struct super_block *, struct ext3_super_block *, unsigned long journal_devnum); static int ext3_create_journal(struct super_block *, struct ext3_super_block *, -@@ -439,6 +445,7 @@ static void ext3_put_super (struct super +@@ -444,6 +450,7 @@ static void ext3_put_super (struct su } if (sbi->s_mmp_tsk) kthread_stop(sbi->s_mmp_tsk); @@ -44,7 +44,41 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c if (sbi->s_dev_proc) { remove_proc_entry(sbi->s_dev_proc->name, proc_root_ext3); sbi->s_dev_proc = NULL; -@@ -1854,6 +1861,45 @@ failed: +@@ -703,7 +710,7 @@ enum { + Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_grpquota, + Opt_extents, Opt_noextents, Opt_extdebug, +- Opt_mballoc, Opt_nomballoc, Opt_stripe, ++ Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize + }; + + static match_table_t tokens = { +@@ -762,8 +769,9 @@ static match_table_t tokens = { + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, +- {Opt_err, NULL}, + {Opt_resize, "resize"}, ++ {Opt_maxdirsize, "maxdirsize=%u"}, ++ {Opt_err, NULL} + }; + + static ext3_fsblk_t get_sb_block(void **data) +@@ -1128,6 +1136,13 @@ clear_qf_name: + return 0; + sbi->s_stripe = option; + break; ++ case Opt_maxdirsize: ++ if (match_int(&args[0], &option)) ++ return 0; ++ if (option <= 0) ++ return 0; ++ sbi->s_max_dir_size = option; ++ break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " +@@ -1875,6 +1890,45 @@ failed: return 1; } @@ -90,7 +124,7 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c static int ext3_fill_super (struct super_block *sb, void *data, int silent) { -@@ -1875,6 +1921,7 @@ static int ext3_fill_super (struct super +@@ -1896,6 +1950,7 @@ static int ext3_fill_super (struct su int i; int needs_recovery; __le32 features; @@ -98,7 +132,7 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c sbi = kmalloc(sizeof(*sbi), GFP_KERNEL); if (!sbi) -@@ -1903,6 +1950,23 @@ static int ext3_fill_super (struct super +@@ -1924,6 +1979,23 @@ static int ext3_fill_super (struct su unlock_kernel(); @@ -106,7 +140,7 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c + proc = create_proc_entry(EXT3_MAX_DIR_SIZE_NAME, + S_IFREG | S_IRUGO | S_IWUSR, sbi->s_dev_proc); + if (proc == NULL) { -+ printk(KERN_ERR "EXT3-fs: unable to create %s\n", ++ printk(KERN_ERR "EXT3-fs: unable to create %s\n", + EXT3_MAX_DIR_SIZE_NAME); + remove_proc_entry(EXT3_MAX_DIR_SIZE_NAME, sbi->s_dev_proc); + remove_proc_entry(sb->s_id, proc_root_ext3); @@ -122,7 +156,7 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c blocksize = sb_min_blocksize(sb, EXT3_MIN_BLOCK_SIZE); if (!blocksize) { printk(KERN_ERR "EXT3-fs: unable to set blocksize\n"); -@@ -2338,6 +2402,7 @@ failed_mount: +@@ -2361,6 +2433,7 @@ failed_mount: ext3_blkdev_remove(sbi); brelse(bh); out_fail: @@ -130,10 +164,10 @@ Index: linux-2.6.18-92.1.17/fs/ext3/super.c if (sbi->s_dev_proc) { remove_proc_entry(sbi->s_dev_proc->name, proc_root_ext3); sbi->s_dev_proc = NULL; -Index: linux-2.6.18-92.1.17/include/linux/ext3_fs_sb.h +Index: linux-stage/include/linux/ext3_fs_sb.h =================================================================== ---- linux-2.6.18-92.1.17.orig/include/linux/ext3_fs_sb.h -+++ linux-2.6.18-92.1.17/include/linux/ext3_fs_sb.h +--- linux-stage.orig/include/linux/ext3_fs_sb.h ++++ linux-stage/include/linux/ext3_fs_sb.h @@ -132,6 +132,8 @@ struct ext3_sb_info { unsigned long s_mb_last_group; unsigned long s_mb_last_start; diff --git a/ldiskfs/kernel_patches/patches/ext3-mballoc3-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-mballoc3-sles10.patch index 655e4bb..6301402 100644 --- a/ldiskfs/kernel_patches/patches/ext3-mballoc3-sles10.patch +++ b/ldiskfs/kernel_patches/patches/ext3-mballoc3-sles10.patch @@ -60,25 +60,25 @@ Index: linux-2.6.16.46-0.14/fs/ext3/super.c =================================================================== --- linux-2.6.16.46-0.14.orig/fs/ext3/super.c +++ linux-2.6.16.46-0.14/fs/ext3/super.c -@@ -685,6 +685,7 @@ enum { - Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, +@@ -681,6 +681,7 @@ enum { Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_grpquota, Opt_extents, Opt_noextents, Opt_extdebug, + Opt_mballoc, Opt_nomballoc, Opt_stripe, - Opt_grpquota }; - + + static match_table_t tokens = { @@ -740,6 +741,9 @@ static match_table_t tokens = { + {Opt_extents, "extents"}, {Opt_noextents, "noextents"}, {Opt_extdebug, "extdebug"}, - {Opt_barrier, "barrier=%u"}, + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, {Opt_err, NULL}, {Opt_resize, "resize"}, }; -@@ -1089,6 +1093,19 @@ clear_qf_name: +@@ -1077,6 +1081,19 @@ clear_qf_name: case Opt_extdebug: set_opt (sbi->s_mount_opt, EXTDEBUG); break; @@ -98,10 +98,11 @@ Index: linux-2.6.16.46-0.14/fs/ext3/super.c default: printk (KERN_ERR "EXT3-fs: Unrecognized mount option \"%s\" " -@@ -1820,6 +1837,7 @@ static int ext3_fill_super (struct super +@@ -1858,7 +1858,7 @@ static int ext3_fill_super (struct super ext3_count_dirs(sb)); ext3_ext_init(sb); +- + ext3_mb_init(sb, needs_recovery); lock_kernel(); return 0;