Skip to contentSkip to conversation

[Fwd: Re: Bug#520286: ext2 module fails to recognize ext4 files with extents on big endian]

Fwd: Re: Bug#520286: ext2 module fails to recognize ext4 files with extents on big endian Felix Zielcke 3 participants 4 messages Mar 18, 2009 – Mar 19, 2009 VFS

lore
Share & tools
lore
#0 lore raw

Any objection that I commit his patch?

-------- Weitergeleitete Nachricht --------
Von: Michel Dänzer <[email protected]>
An: Felix Zielcke <[email protected]>
Kopie: [email protected]
Betreff: Re: Bug#520286: ext2 module fails to recognize ext4 files with extents on big endian
Datum: Wed, 18 Mar 2009 18:41:47 +0100

Quoted 7 lines · Felix Zielcke

Am Mittwoch, den 18.03.2009, 18:00 +0100 schrieb Michel Dänzer:

Quoted 4 lines

The function grub_ext2_read_block() doesn't take endianness into account when checking the inode flags for EXT4_EXTENTS_FLAG, so the check doesn't work properly on big endian. The attached patch fixes this, it was necessary for loading and booting a Linux kernel from an ext4 filesystem on my PowerBook.

Quoted 5 lines

Hi,

it would be nice if you could write a ChangeLog entry for this and send your patch directly upstream to [email protected], though you need to subscribe first.

Last time I tried this wasn't too pleasant an experience for me I'm afraid (as a result I filed #516458, which was fixed with a different patch, for which I thanked the author personally). The attached includes a ChangeLog entry, but I'd appreciate if you or someone else could take care of getting it integrated upstream.

Thanks,

Signature · 1 line
Felix Zielcke
fs/ext2.c +1 -1
@@ -385,7 +385,7 @@ grub_ext2_read_block (grub_fshelp_node_t
   unsigned int blksz = EXT2_BLOCK_SIZE (data);
   int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data);
   
-  if (inode->flags & EXT4_EXTENTS_FLAG)
+  if (grub_le_to_cpu32(inode->flags) & EXT4_EXTENTS_FLAG)
     {
       char buf[EXT2_BLOCK_SIZE(data)];
       struct grub_ext4_extent_header *leaf;
ChangeLog +5 -0
@@ -0,0 +1,5 @@
+2009-03-18  Michel Dänzer  <[email protected]>
+
+	* fs/ext2.c (grub_ext2_read_block): Take endianness into account when
+	checking inode flags for EXT4_EXTENTS_FLAG.
+
#1 lore raw

Hello!
None from me, this week.
Especially since we need to move GRUB2 to the point that it is fully ready to take things over, with regards to Debian and related distributions. --
Gregg C Levine [email protected]
"The Force will be with you always." Obi-Wan Kenobi

Quoted 2 lines

-----Original Message-----
From: [email protected]

[mailto:grub-devel-

Quoted 4 lines

[email protected]] On Behalf Of Felix Zielcke
Sent: Wednesday, March 18, 2009 1:55 PM
To: The development of GRUB 2
Subject: [Fwd: Re: Bug#520286: ext2 module fails to recognize ext4 files

with extents on

Quoted 12 lines

big endian]

Any objection that I commit his patch?

-------- Weitergeleitete Nachricht --------
Von: Michel DC$nzer <[email protected]>
An: Felix Zielcke <[email protected]>
Kopie: [email protected]
Betreff: Re: Bug#520286: ext2 module fails to recognize ext4 files with extents on big endian
Datum: Wed, 18 Mar 2009 18:41:47 +0100

Quoted 4 lines
Quoted 3 lines · Felix Zielcke

Am Mittwoch, den 18.03.2009, 18:00 +0100 schrieb Michel DC$nzer:

Quoted 1 line

The function grub_ext2_read_block() doesn't take endianness into

account

Quoted 1 line
Quoted 1 line
Quoted 1 line

when checking the inode flags for EXT4_EXTENTS_FLAG, so the check

doesn't

Quoted 1 line
Quoted 1 line
Quoted 1 line

work properly on big endian. The attached patch fixes this, it was

necessary

Quoted 1 line
Quoted 1 line
Quoted 1 line

for loading and booting a Linux kernel from an ext4 filesystem on my

PowerBook.

Quoted 18 lines
Quoted 6 lines

Hi,

it would be nice if you could write a ChangeLog entry for this and send your patch directly upstream to [email protected], though you need to subscribe first.

Last time I tried this wasn't too pleasant an experience for me I'm afraid (as a result I filed #516458, which was fixed with a different patch, for which I thanked the author personally). The attached includes a ChangeLog entry, but I'd appreciate if you or someone else could take care of getting it integrated upstream.

Thanks,

--
Felix Zielcke

#2 lore raw
In reply to Felix Zielcke
Quoted 1 line · Felix Zielcke

Any objection that I commit his patch?

I don't have the beginning of this thread, but I confirm that the check for EXT4_EXTENTS_FLAG won't work on big-endian machines. What's worse, the bug might affect ext2 and ext3 on such machines as well. So please go ahead even if that's not a complete fix.

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw

Am Donnerstag, den 19.03.2009, 04:23 -0400 schrieb Pavel Roskin:

Quoted 4 lines

I don't have the beginning of this thread, but I confirm that the check for EXT4_EXTENTS_FLAG won't work on big-endian machines. What's worse, the bug might affect ext2 and ext3 on such machines as well. So please go ahead even if that's not a complete fix.

There was no thread here about this, this has been only reported on Debian BTS [0] and my forwarded mail contains everything important from that one.

I commited this now.

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520286

Signature · 1 line
Felix Zielcke