Skip to contentSkip to conversation

SILO fails to read silo.conf from EXT4 FS

DISCUSSION Raúl Porcel 2 participants 5 messages Jul 29, 2012 – Aug 19, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

With the rewrite of the e2fs part of SILO, its unable to read /etc/silo.conf from an EXT4 FS. It can read from EXT2 and EXT3, though.

Dumpe2fs from the partition where silo.conf is located:

dumpe2fs 1.42 (29-Nov-2011)

Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          6027fece-1dd0-4d2e-8f03-c182f8101ed8
Filesystem magic number:  0xEF53

Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index
filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize

Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              2084880
Block count:              8334336
Reserved block count:     416716
Free blocks:              7654482
Free inodes:              1844855
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1022
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8176
Inode blocks per group:   511
Flex block group size:    16
Filesystem created:       Sun Jul 29 12:49:50 2012
Last mount time:          Sun Jul 29 13:28:47 2012
Last write time:          Sun Jul 29 13:27:35 2012
Mount count:              2
Maximum mount count:      -1
Last checked:             Sun Jul 29 12:49:50 2012
Check interval:           0 (<none>)
Lifetime writes:          132 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:	          256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      5e059fc0-418d-4c25-b1ce-afbf97717450
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x000000a3
Journal start:            1

Log from boot:

Rebooting with command: boot

Boot device: disk1 File and args:

SILO Version 1.4.14_git2012226_p1

Cannot find /etc/silo.conf (error: 4294967295)

Couldn't load /etc/silo.conf

No config file loaded, you can boot just from this command line

Type [prompath;]part/path_to_image [parameters] on the prompt

E.g. /iommu/sbus/espdma/esp/sd@3,0;4/vmlinux root=/dev/sda4

or 2/vmlinux.live (to load vmlinux.live from 2nd partition of boot disk)

boot:

Obviously the version where it used the e2fsprogs libs works fine.

Thanks

#1 lore raw

From: Raúl Porcel <[email protected]>
Date: Sun, 29 Jul 2012 13:35:54 +0200

Quoted 5 lines

With the rewrite of the e2fs part of SILO, its unable to read /etc/silo.conf from an EXT4 FS. It can read from EXT2 and EXT3, though.

Dumpe2fs from the partition where silo.conf is located:

Thanks for the report, I'll try to fix this.

#2 lore raw
In reply to Raúl Porcel

From: Raúl Porcel <[email protected]>
Date: Sun, 29 Jul 2012 13:35:54 +0200

Quoted 3 lines

With the rewrite of the e2fs part of SILO, its unable to read /etc/silo.conf from an EXT4 FS. It can read from EXT2 and EXT3, though.

There are some minor errors in the extent leaf traversal, can you try this patch below?

If this fails I'll give you a patch which adds some tracing so we can diagnose this further.

Thanks!

second/fs/ext2.c +4 -3
index 7eb665f..018aced 100644
@@ -147,7 +147,7 @@ static struct ext4_extent_header *search_leaf(struct silo_ext2_state *s,
 			return ehp;
 
 		for (i = 0; i < ext2_to_cpu_16(ehp->eh_entries); i++, idxp++)
-			if (ext2_to_cpu_32(idxp->ei_block) > file_block)
+			if (file_block < ext2_to_cpu_32(idxp->ei_block))
 				break;
 
 		if (i = 0)
@@ -226,14 +226,15 @@ static unsigned long long resolve_extent(struct silo_ext2_state *s,
 	ep = (struct ext4_extent *) (ehp + 1);
 
 	for (i = 0; i < ext2_to_cpu_16(ehp->eh_entries); i++, ep++)
-		if (ext2_to_cpu_32(ep->ee_block) > file_block)
+		if (file_block < ext2_to_cpu_32(ep->ee_block))
 			break;
 
 	if (i = 0)
 		return BLOCK_MAP_ERROR;
 
+	ep -= 1;
 	file_block -= ext2_to_cpu_32(ep->ee_block);
-	if (ext2_to_cpu_16(ep->ee_len) < file_block)
+	if (file_block >= ext2_to_cpu_16(ep->ee_len))
 		return BLOCK_MAP_ERROR;
 
 	hi = ((unsigned long long)ext2_to_cpu_16(ep->ee_start_hi)) << 32;
#3 lore raw
In reply to Raúl Porcel
Quoted 10 lines · David Miller

From: Raúl Porcel<[email protected]>
Date: Sun, 29 Jul 2012 13:35:54 +0200

Quoted 3 lines

With the rewrite of the e2fs part of SILO, its unable to read /etc/silo.conf from an EXT4 FS. It can read from EXT2 and EXT3, though.

There are some minor errors in the extent leaf traversal, can you try this patch below?

Quoted 6 lines

If this fails I'll give you a patch which adds some tracing so we can diagnose this further.

Thanks!

[snip]

That fixed it.

Thanks!

#4 lore raw
In reply to Raúl Porcel

From: Raúl Porcel <[email protected]>
Date: Sat, 18 Aug 2012 18:02:40 +0200

Quoted 11 lines · David Miller
Quoted 10 lines

From: Raúl Porcel<[email protected]>
Date: Sun, 29 Jul 2012 13:35:54 +0200

Quoted 3 lines

With the rewrite of the e2fs part of SILO, its unable to read /etc/silo.conf from an EXT4 FS. It can read from EXT2 and EXT3, though.

There are some minor errors in the extent leaf traversal, can you try this patch below?

Quoted 8 lines
Quoted 6 lines

If this fails I'll give you a patch which adds some tracing so we can diagnose this further.

Thanks!

[snip]

That fixed it.

And now committed to git, thanks a lot for testing.