From: Eric Sandeen <esandeen@redhat.com>
To: linux-kernel@vger.kernel.org, ext2-devel@lists.sourceforge.net
Cc: "Stephen C. Tweedie" <sct@redhat.com>
Subject: [PATCH] endianness fixes for 16T ext patches
Date: Tue, 29 Aug 2006 11:50:06 -0500 [thread overview]
Message-ID: <44F4703E.5060300@redhat.com> (raw)
Whoops... thanks for pointing this out, Stephen...
Fix some endian errors in the 16T ext[23] patches I sent in the past couple weeks.
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Index: linux-2.6.17/fs/ext2/super.c
===================================================================
--- linux-2.6.17.orig/fs/ext2/super.c
+++ linux-2.6.17/fs/ext2/super.c
@@ -514,7 +514,7 @@ static int ext2_check_descriptors (struc
for (i = 0; i < sbi->s_groups_count; i++)
{
if (i == sbi->s_groups_count - 1)
- last_block = sbi->s_es->s_blocks_count - 1;
+ last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1;
else
last_block = first_block +
(EXT2_BLOCKS_PER_GROUP(sb) - 1);
Index: linux-2.6.17/fs/ext3/resize.c
===================================================================
--- linux-2.6.17.orig/fs/ext3/resize.c
+++ linux-2.6.17/fs/ext3/resize.c
@@ -730,12 +730,14 @@ int ext3_group_add(struct super_block *s
return -EPERM;
}
- if (es->s_blocks_count + input->blocks_count < es->s_blocks_count) {
+ if (le32_to_cpu(es->s_blocks_count) + input->blocks_count <
+ le32_to_cpu(es->s_blocks_count)) {
ext3_warning(sb, __FUNCTION__, "blocks_count overflow\n");
return -EINVAL;
}
- if (es->s_inodes_count+EXT3_INODES_PER_GROUP(sb) < es->s_inodes_count) {
+ if (le32_to_cpu(es->s_inodes_count) + EXT3_INODES_PER_GROUP(sb) <
+ le32_to_cpu(es->s_inodes_count)) {
ext3_warning(sb, __FUNCTION__, "inodes_count overflow\n");
return -EINVAL;
}
Index: linux-2.6.17/fs/ext3/super.c
===================================================================
--- linux-2.6.17.orig/fs/ext3/super.c
+++ linux-2.6.17/fs/ext3/super.c
@@ -1143,7 +1143,7 @@ static int ext3_check_descriptors (struc
for (i = 0; i < sbi->s_groups_count; i++)
{
if (i == sbi->s_groups_count - 1)
- last_block = sbi->s_es->s_blocks_count - 1;
+ last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1;
else
last_block = first_block +
(EXT3_BLOCKS_PER_GROUP(sb) - 1);
reply other threads:[~2006-08-29 16:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44F4703E.5060300@redhat.com \
--to=esandeen@redhat.com \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox