diff mbox

[U-Boot] PATCH, RESEND] ext4fs: le32_to_cpu() used on a 16-bit field

Message ID 20130720082342.GA6081@CrG.local
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Mela Custodio July 20, 2013, 8:23 a.m. UTC
From 08b32b6511035c4a558773a992eb1ffa63521349 Mon Sep 17 00:00:00 2001
In-Reply-To: <20130719090305.16c47d8e@amdc308.digital.local>
References: <20130719090305.16c47d8e@amdc308.digital.local>
From: Rommel G Custodio <sessyargc.jp@gmail.com>
Date: Sat, 20 Jul 2013 17:03:23 +0900
Subject: [PATCH, RESEND] ext4fs: le32_to_cpu() used on a 16-bit field
To: u-boot@lists.denx.de
Cc: Lukasz Majewski <l.majewski@samsung.com>

Dear Lukasz Majewski

On 2013.07/19, Lukasz Majewski wrote:
> fatal: corrupt patch at line 111
>
> I cannot apply this patch with either git am -3 or git apply.


I'm resending the patch.
>> (Sorry, I can't CC anyone directly as I'm using the gmane "post"
>> interface)

All the best,
Rommel

Signed-off-by: Rommel G Custodio <sessyargc.jp@gmail.com>
---
 fs/ext4/ext4_common.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Albert ARIBAUD July 20, 2013, 12:25 p.m. UTC | #1
Hi Rommel,

On Sat, 20 Jul 2013 17:23:42 +0900, Rommel G Custodio
<sessyargc@gmail.com> wrote:

> From 08b32b6511035c4a558773a992eb1ffa63521349 Mon Sep 17 00:00:00 2001
> In-Reply-To: <20130719090305.16c47d8e@amdc308.digital.local>
> References: <20130719090305.16c47d8e@amdc308.digital.local>
> From: Rommel G Custodio <sessyargc.jp@gmail.com>
> Date: Sat, 20 Jul 2013 17:03:23 +0900
> Subject: [PATCH, RESEND] ext4fs: le32_to_cpu() used on a 16-bit field
> To: u-boot@lists.denx.de
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> 
> Dear Lukasz Majewski
> 
> On 2013.07/19, Lukasz Majewski wrote:
> > fatal: corrupt patch at line 111
> >
> > I cannot apply this patch with either git am -3 or git apply.
> 
> 
> I'm resending the patch.
> >> (Sorry, I can't CC anyone directly as I'm using the gmane "post"
> >> interface)

Alas, this means your "I'm resending the patch", along with your
partial quotation of a review, is now part of, and obscuring, the commit
message. :(

Also, I cannot apply this re-sent patch on u-boot/master.

Please simply send the patch using git format-patch and git send-email.
You should try sending the patch to yourself only at first, in order to
make sure the commit message is right and the patch itself is correct
and can be applied; then you should sent it to the list, still using git
send-email.

> All the best,
> Rommel

Amicalement,
diff mbox

Patch

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 2776293..ff9c4ec 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -1432,7 +1432,7 @@  static struct ext4_extent_header *ext4fs_get_extent_block
 	while (1) {
 		index = (struct ext4_extent_idx *)(ext_block + 1);
 
-		if (le32_to_cpu(ext_block->eh_magic) != EXT4_EXT_MAGIC)
+		if (le16_to_cpu(ext_block->eh_magic) != EXT4_EXT_MAGIC)
 			return 0;
 
 		if (ext_block->eh_depth == 0)
@@ -1440,14 +1440,14 @@  static struct ext4_extent_header *ext4fs_get_extent_block
 		i = -1;
 		do {
 			i++;
-			if (i >= le32_to_cpu(ext_block->eh_entries))
+			if (i >= le16_to_cpu(ext_block->eh_entries))
 				break;
 		} while (fileblock > le32_to_cpu(index[i].ei_block));
 
 		if (--i < 0)
 			return 0;
 
-		block = le32_to_cpu(index[i].ei_leaf_hi);
+		block = le16_to_cpu(index[i].ei_leaf_hi);
 		block = (block << 32) + le32_to_cpu(index[i].ei_leaf_lo);
 
 		if (ext4fs_devread((lbaint_t)block << log2_blksz, 0, fs->blksz,
@@ -1548,17 +1548,17 @@  long int read_allocated_block(struct ext2_inode *inode, int fileblock)
 
 		do {
 			i++;
-			if (i >= le32_to_cpu(ext_block->eh_entries))
+			if (i >= le16_to_cpu(ext_block->eh_entries))
 				break;
 		} while (fileblock >= le32_to_cpu(extent[i].ee_block));
 		if (--i >= 0) {
 			fileblock -= le32_to_cpu(extent[i].ee_block);
-			if (fileblock >= le32_to_cpu(extent[i].ee_len)) {
+			if (fileblock >= le16_to_cpu(extent[i].ee_len)) {
 				free(buf);
 				return 0;
 			}
 
-			start = le32_to_cpu(extent[i].ee_start_hi);
+			start = le16_to_cpu(extent[i].ee_start_hi);
 			start = (start << 32) +
 					le32_to_cpu(extent[i].ee_start_lo);
 			free(buf);