Skip to contentSkip to conversation

problem mounting a jffs2 filesystem

DISCUSSION Miguel Blanco 4 participants 6 messages Mar 5, 2006 – Mar 9, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hello,

Trying to mount a jffs2 file system in my desktop PC:
...

 $ modprobe mtdram total_size=6144 erase_size=128
 $ modprobe mtdblock
 ...
 $ dd if=fw.wsw of=data.jffs2 ibs=1 obs=1M count=5888K skip=6292872
 $ jffs2dump -b -c -e data-le.jffs2 data.jffs2
 $ dd if=data-le.jffs2 of=/dev/mtdblock0
 $ mkdir data
 $ mount -t jffs2 /dev/mtdblock0 data

I get a mount error:
"2942 Violación de segmento" (in spanish and "segment violation"
in english :-) )

and dmesg says (relevant part I think):

divide error: 0000 [#1]
last sysfs file: /block/mtdblock0/dev

 Modules linked in: jffs2 zlib_deflate mtdblock mtd_blkdevs mtdram

mtdpart mtdcor e parport_pc lp parport autofs4 dm_mod video button battery ac ipv6 ohci1394 iee e1394 uhci_hcd ehci_hcd i2c_i801 i2c_core snd_intel8x0 snd_ac97_codec snd_ac97_b us snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_o ss snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc 8139cp 8139too m ii floppy sr_mod ext3 jbd aic7xxx scsi_transport_spi sd_mod scsi_mod
CPU: 0
EIP: 0060:[<e118deef>] Not tainted VLI
EFLAGS: 00210246 (2.6.15-1.1830_FC4)
EIP is at jffs2_scan_medium+0xdf/0x55e [jffs2]

 eax: 0000fff4   ebx: d2c5fa00   ecx: dffef180   edx: 00000000
 esi: d07d24e0   edi: d07d28d0   ebp: d3c98a80   esp: d0995d80
 ds: 007b   es: 007b   ss: 0068
 Process mount (pid: 2942, threadinfo=d0995000 task=d311b030)
 Stack: 00000000 d3c98a80 d0995da4 00000080 00000030 00000002 00000000 00000000
        00600000 e0b58000 d2c5fa00 00000030 d2c5fa00 00000000 e119107a d2c5fa00
        d3c98338 fffffff4 c0152c19 ffffffff e119611d 000000d0 00000000 d2c5fa00
 Call Trace:
  [<e119107a>] jffs2_build_filesystem+0x1a
/0x306 [jffs2]     [<c0152c19>] __vmall oc+0xf/0x13
  [<e119611d>] jffs2_sum_init+0x3d/0xbf [jffs2]     [<e1191609>]
jffs2_do_mount_f s+0x1cc/0x233 [jffs2]
  [<e119300c>] jffs2_do_fill_super+0xa8/0x1cb [jffs2]     [<e1193647>]
jffs2_sb_s et+0x0/0x1d [jffs2]
  [<e119385f>] jffs2_get_sb_mtd+0x1fb/0x22c [jffs2]     [<e11939b5>]
jffs2_get_sb +0xe7/0x192 [jffs2]
  [<c017502b>] alloc_vfsmnt+0x9b/0xc2     [<c0174f79>] get_fs_type+0x8d/0xa4
  [<c0161d29>] do_kern_mount+0xaf/0x147     [<c0176437>] do_new_mount+0x6b/0x90
  [<c0176a37>] do_mount+0x1b1/0x1cc     [<c01422e0>] __alloc_pages+0x57/0x2ed
  [<c017683d>] copy_mount_options+0x4d/0x96     [<c0176db4>] sys_mount+0x72/0xa4
  [<c0102e75>] syscall_call+0x7/0xb
 Code: 8b 93 b0 00 00 00 8b 42 18 01 43 7c 8b 43 78 2b 42 18 89 43 78

c7 42 18 00 00 00 00 8b b3 b0 00 00 00 85 f6 74 24 8b 46 20 31 d2 <f7> b3 84 01 00 00 85 d2 74 15 01 56 1c 01 53 7c 8b 83 b0 00 00
Continuing in 1 seconds.
<6>loop: loaded (max 8 devices)

this is with Fedora 4 kernel 2.6.15-1.1830 (and later kernels).
2.6.14.1.1656 is OK!

I know is a vendor kernel, but the 2.6.15 ChangeLog contains a lot of
changes related
to mtd devices and jffs2 filesystems, so I think it could be a mainline bug.

Let me know if you need more information.

Thank you,
Miguel.

#1 lore raw
Quoted 60 lines · Miguel Blanco

Hello,

Trying to mount a jffs2 file system in my desktop PC:
...

 $ modprobe mtdram total_size=6144 erase_size=128
 $ modprobe mtdblock
 ...
 $ dd if=fw.wsw of=data.jffs2 ibs=1 obs=1M count=5888K skip=6292872
 $ jffs2dump -b -c -e data-le.jffs2 data.jffs2
 $ dd if=data-le.jffs2 of=/dev/mtdblock0
 $ mkdir data
 $ mount -t jffs2 /dev/mtdblock0 data

I get a mount error:
"2942 Violación de segmento" (in spanish and "segment violation"
in english :-) )

and dmesg says (relevant part I think):

divide error: 0000 [#1]
last sysfs file: /block/mtdblock0/dev

 Modules linked in: jffs2 zlib_deflate mtdblock mtd_blkdevs mtdram

mtdpart mtdcor e parport_pc lp parport autofs4 dm_mod video button battery ac ipv6 ohci1394 iee e1394 uhci_hcd ehci_hcd i2c_i801 i2c_core snd_intel8x0 snd_ac97_codec snd_ac97_b us snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_o ss snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc 8139cp 8139too m ii floppy sr_mod ext3 jbd aic7xxx scsi_transport_spi sd_mod scsi_mod
CPU: 0
EIP: 0060:[<e118deef>] Not tainted VLI
EFLAGS: 00210246 (2.6.15-1.1830_FC4)
EIP is at jffs2_scan_medium+0xdf/0x55e [jffs2]

 eax: 0000fff4   ebx: d2c5fa00   ecx: dffef180   edx: 00000000
 esi: d07d24e0   edi: d07d28d0   ebp: d3c98a80   esp: d0995d80
 ds: 007b   es: 007b   ss: 0068
 Process mount (pid: 2942, threadinfo=d0995000 task=d311b030)
 Stack: 00000000 d3c98a80 d0995da4 00000080 00000030 00000002 00000000 00000000
        00600000 e0b58000 d2c5fa00 00000030 d2c5fa00 00000000 e119107a d2c5fa00
        d3c98338 fffffff4 c0152c19 ffffffff e119611d 000000d0 00000000 d2c5fa00
 Call Trace:
  [<e119107a>] jffs2_build_filesystem+0x1a
/0x306 [jffs2]     [<c0152c19>] __vmall oc+0xf/0x13
  [<e119611d>] jffs2_sum_init+0x3d/0xbf [jffs2]     [<e1191609>]
jffs2_do_mount_f s+0x1cc/0x233 [jffs2]
  [<e119300c>] jffs2_do_fill_super+0xa8/0x1cb [jffs2]     [<e1193647>]
jffs2_sb_s et+0x0/0x1d [jffs2]
  [<e119385f>] jffs2_get_sb_mtd+0x1fb/0x22c [jffs2]     [<e11939b5>]
jffs2_get_sb +0xe7/0x192 [jffs2]
  [<c017502b>] alloc_vfsmnt+0x9b/0xc2     [<c0174f79>] get_fs_type+0x8d/0xa4
  [<c0161d29>] do_kern_mount+0xaf/0x147     [<c0176437>] do_new_mount+0x6b/0x90
  [<c0176a37>] do_mount+0x1b1/0x1cc     [<c01422e0>] __alloc_pages+0x57/0x2ed
  [<c017683d>] copy_mount_options+0x4d/0x96     [<c0176db4>] sys_mount+0x72/0xa4
  [<c0102e75>] syscall_call+0x7/0xb
 Code: 8b 93 b0 00 00 00 8b 42 18 01 43 7c 8b 43 78 2b 42 18 89 43 78

c7 42 18 00 00 00 00 8b b3 b0 00 00 00 85 f6 74 24 8b 46 20 31 d2 <f7> b3 84 01 00 00 85 d2 74 15 01 56 1c 01 53 7c 8b 83 b0 00 00
Continuing in 1 seconds.
<6>loop: loaded (max 8 devices)

Quoted 8 lines

this is with Fedora 4 kernel 2.6.15-1.1830 (and later kernels).
2.6.14.1.1656 is OK!

I know is a vendor kernel, but the 2.6.15 ChangeLog contains a lot of
changes related
to mtd devices and jffs2 filesystems, so I think it could be a mainline bug.

Let me know if you need more information.

You should CC the MTD mailing list as well. They might be able to help you a bit more.

josh

#2 lore raw
In reply to Miguel Blanco
Quoted 2 lines · Miguel Blanco

divide error: 0000 [#1]
EIP is at jffs2_scan_medium+0xdf/0x55e [jffs2]

Can you try it with the attached patch? Or turn off CONFIG_JFFS2_FS_WRITEBUFFER

Signature · 1 line
dwmw2

Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv28853

Modified Files:
scan.c
Log Message:
Avoid divide-by-zero

Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.134
retrieving revision 1.135

scan.c +1 -1
diff -u -r1.134 -r1.135
@@ -239,7 +239,7 @@
 		c->nextblock->dirty_size = 0;
 	}
 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
-	if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
+	if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
 		/* If we're going to start writing into a block which already
 		   contains data, and the end of the data isn't page-aligned,
 		   skip a little and align it. */

__________________________________________________________
Linux-MTD CVS commit list
http://lists.infradead.org/mailman/listinfo/linux-mtd-cvs/

#3 lore raw

Yes, It works now with the patch !!!

Thank you.

Miguel.

2006/3/6, David Woodhouse <[email protected]>:

Quoted 50 lines · Miguel Blanco
Quoted 2 lines

divide error: 0000 [#1]
EIP is at jffs2_scan_medium+0xdf/0x55e [jffs2]

Can you try it with the attached patch? Or turn off CONFIG_JFFS2_FS_WRITEBUFFER

--
dwmw2

---------- Mensaje reenviado ----------
From: David Woodhouse <[email protected]>
To: [email protected]
Date: Thu, 09 Feb 2006 16:13:01 +0000
Subject: mtd/fs/jffs2 scan.c,1.134,1.135 Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv28853

Modified Files:
scan.c
Log Message:
Avoid divide-by-zero

Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -r1.134 -r1.135

scan.c 9 Feb 2006 16:12:59 -0000 1.135 renamed from scan.c 13 Jan 2006 10:25:29 -0000 1.134 +1 -1
@@ -239,7 +239,7 @@
                c->nextblock->dirty_size = 0;
        }
 #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
-       if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
+       if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
                /* If we're going to start writing into a block which already
                   contains data, and the end of the data isn't page-aligned,
                   skip a little and align it. */

__________________________________________________________
Linux-MTD CVS commit list
http://lists.infradead.org/mailman/listinfo/linux-mtd-cvs/

#4 lore raw
In reply to David Woodhouse
Quoted 6 lines · David Woodhouse
Quoted 2 lines · Miguel Blanco

divide error: 0000 [#1]
EIP is at jffs2_scan_medium+0xdf/0x55e [jffs2]

Can you try it with the attached patch? Or turn off CONFIG_JFFS2_FS_WRITEBUFFER

This patch seems to be 2.61.6 stuff?

Quoted 2 lines

dwmw2
...

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw
Quoted 9 lines · Adrian Bunk
Quoted 6 lines · David Woodhouse
Quoted 2 lines · Miguel Blanco

divide error: 0000 [#1]
EIP is at jffs2_scan_medium+0xdf/0x55e [jffs2]

Can you try it with the attached patch? Or turn off CONFIG_JFFS2_FS_WRITEBUFFER

This patch seems to be 2.61.6 stuff?

I would agree that it could be 2.6.16 material. Especially given that it fixes a know problem for a user. David?

josh