From 2d16ac7d255eedd07b9e102c9d85f8b44741648e Mon Sep 17 00:00:00 2001 From: kalpak Date: Wed, 5 Nov 2008 10:03:54 +0000 Subject: [PATCH] b=16438 i=adilger i=girish Mounting a filesystem with extents feature will fail on big-endian systems since ext3-based ldiskfs is not supported on big-endian systems. This can be over-riden with "bigendian_extents" mount option. --- .../patches/ext3-big-endian-check-2.6-rhel5.patch | 56 +++++++++++++++++++++ .../patches/ext3-big-endian-check-2.6-sles10.patch | 57 ++++++++++++++++++++++ .../ext3-big-endian-check-2.6.22-vanilla.patch | 56 +++++++++++++++++++++ .../kernel_patches/series/ldiskfs-2.6-rhel5.series | 1 + .../series/ldiskfs-2.6-sles10.series | 1 + .../series/ldiskfs-2.6.22-vanilla.series | 1 + 6 files changed, 172 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-rhel5.patch create mode 100644 ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-sles10.patch create mode 100644 ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6.22-vanilla.patch 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 new file mode 100644 index 0000000..7631428 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-rhel5.patch @@ -0,0 +1,56 @@ +Index: linux-2.6.18-92.1.6/fs/ext3/super.c +=================================================================== +--- linux-2.6.18-92.1.6.orig/fs/ext3/super.c ++++ linux-2.6.18-92.1.6/fs/ext3/super.c +@@ -71,6 +71,8 @@ static void ext3_unlockfs(struct super_b + static void ext3_write_super (struct super_block * sb); + static void ext3_write_super_lockfs(struct super_block *sb); + ++static int bigendian_extents; ++ + /* + * Wrappers for journal_start/end. + * +@@ -712,7 +714,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_hashfunc, + }; + +@@ -772,6 +774,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_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, +@@ -1137,6 +1140,9 @@ 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; +@@ -2250,6 +2256,15 @@ static int ext3_fill_super (struct super + goto failed_mount; + } + ++#ifdef __BIG_ENDIAN ++ if (bigendian_extents == 0) { ++ printk(KERN_ERR "EXT3-fs: extents feature is not guaranteed to " ++ "work on big-endian systems. Use \"bigendian_extents\" " ++ "mount option to override.\n") ++ goto failed_mount; ++ } ++#endif ++ + bgl_lock_init(&sbi->s_blockgroup_lock); + + sbi->s_last_alloc_group = -1; 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 new file mode 100644 index 0000000..694b91e --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6-sles10.patch @@ -0,0 +1,57 @@ +Index: linux-2.6.16.60-0.27/fs/ext3/super.c +=================================================================== +--- linux-2.6.16.60-0.27.orig/fs/ext3/super.c ++++ linux-2.6.16.60-0.27/fs/ext3/super.c +@@ -72,6 +72,8 @@ static void ext3_unlockfs(struct super_b + static void ext3_write_super (struct super_block * sb); + static void ext3_write_super_lockfs(struct super_block *sb); + ++static int bigendian_extents; ++ + /* + * Wrappers for journal_start/end. + * +@@ -709,7 +711,7 @@ enum { + 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_extents, Opt_noextents, Opt_extdebug, ++ Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, + Opt_mballoc, Opt_nomballoc, Opt_stripe, + Opt_grpquota, Opt_hashfunc + }; +@@ -768,6 +770,7 @@ static match_table_t tokens = { + {Opt_iopen_nopriv, "iopen_nopriv"}, + {Opt_extents, "extents"}, + {Opt_noextents, "noextents"}, ++ {Opt_bigendian_extents, "bigendian_extents"}, + {Opt_extdebug, "extdebug"}, + {Opt_barrier, "barrier=%u"}, + {Opt_mballoc, "mballoc"}, +@@ -1130,6 +1133,9 @@ 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; +@@ -2078,6 +2084,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"); ++ goto failed_mount; ++ } ++#endif ++ + sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | + ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); + diff --git a/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6.22-vanilla.patch b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6.22-vanilla.patch new file mode 100644 index 0000000..3974c09 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-big-endian-check-2.6.22-vanilla.patch @@ -0,0 +1,56 @@ +Index: linux-2.6.22.14/fs/ext3/super.c +=================================================================== +--- linux-2.6.22.14.orig/fs/ext3/super.c ++++ linux-2.6.22.14/fs/ext3/super.c +@@ -71,6 +71,8 @@ static void ext3_unlockfs(struct super_b + static void ext3_write_super (struct super_block * sb); + static void ext3_write_super_lockfs(struct super_block *sb); + ++static int bigendian_extents; ++ + /* + * Wrappers for journal_start/end. + * +@@ -706,7 +708,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_hashfunc, + }; +@@ -763,6 +765,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_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, +@@ -1119,6 +1122,9 @@ 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; +@@ -2235,6 +2241,15 @@ static int ext3_fill_super (struct super + goto failed_mount; + } + ++#ifdef __BIG_ENDIAN ++ if (bigendian_extents == 0) { ++ printk(KERN_ERR "EXT3-fs: extents feature is not guaranteed to " ++ "work on big-endian systems. Use \"bigendian_extents\" " ++ "mount option to override.\n"); ++ goto failed_mount; ++ } ++#endif ++ + bgl_lock_init(&sbi->s_blockgroup_lock); + + sbi->s_last_alloc_group = -1; diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series index dc7d60d..280f3d5 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series @@ -29,3 +29,4 @@ ext3-xattr-no-update-ctime-2.6-sles10.patch ext3-fiemap-2.6-rhel5.patch ext3-journal-chksum-2.6.18-vanilla.patch ext3-get-raid-stripe-from-sb.patch +ext3-big-endian-check-2.6-rhel5.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series index dbe884b..4bc5c3b 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series @@ -34,3 +34,4 @@ ext3-xattr-no-update-ctime-2.6-sles10.patch ext3-check-bad-inode.patch ext3-fiemap-2.6-sles10.patch ext3-get-raid-stripe-from-sb.patch +ext3-big-endian-check-2.6-sles10.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series index bf07835..fe4f0c0 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series @@ -28,3 +28,4 @@ ext3-xattr-no-update-ctime-2.6-sles10.patch ext3-check-bad-inode.patch ext3-fiemap-2.6.22-vanilla.patch ext3-get-raid-stripe-from-sb.patch +ext3-big-endian-check-2.6.22-vanilla.patch -- 1.8.3.1