Hello! This is Kernel 2.4.6-ac1 with ext3-0.8.0 compiled with cvs-gcc version 3.1 20010616 on alpha ev4. I have prepared one ext3 filesystem to play with. When my rc-scripts call mount -a during boot I receive this: Jul 6 22:01:30 Marvin kernel: Bad unaligned kernel access at fffffc0000883f54: fffffc00063f2e6e 2a 2 and the mount of this filesystem fails. A subsequent manual second try to mount puts the mount process into 'D' state (i.e. it never completes). Now System map shows the fault occurs in ext3_bmap: fffffc0000883c00 t ext3_commit_write fffffc0000883e60 t ext3_abort_write fffffc0000883f30 t ext3_bmap fffffc0000883fe0 t bget_one fffffc0000884000 t ext3_writepage fffffc0000884340 t ext3_readpage fffffc0000884380 t ext3_flushpage Disassembly of section .text: fffffc0000883f30 <ext3_bmap>: fffffc0000883f30: 34 00 bb 27 ldah gp,52(t12) fffffc0000883f34: 18 16 bd 23 lda gp,5656(gp) fffffc0000883f38: e0 ff de 23 lda sp,-32(sp) fffffc0000883f3c: 08 00 3e b5 stq s0,8(sp) fffffc0000883f40: 09 04 f0 47 mov a0,s0 fffffc0000883f44: 10 00 5e b5 stq s1,16(sp) fffffc0000883f48: 0a 04 f1 47 mov a1,s1 fffffc0000883f4c: 00 00 5e b7 stq ra,0(sp) fffffc0000883f50: 40 00 69 a4 ldq t2,64(s0) fffffc0000883f54: 2e 02 43 a8 ldl_l t1,558(t2) fffffc0000883f58: 01 50 40 44 and t1,0x2,t0 fffffc0000883f5c: 03 00 20 e4 beq t0,fffffc0000883f6c <ext3_bmap+0x3c> fffffc0000883f60: 02 58 40 44 xor t1,0x2,t1 fffffc0000883f64: 2e 02 43 b8 stl_c t1,558(t2) fffffc0000883f68: 58 09 40 e4 beq t1,fffffc00008864cc <ext3_journal_get_write_access+0x5c> fffffc0000883f6c: 10 00 20 e4 beq t0,fffffc0000883fb0 <ext3_bmap+0x80> fffffc0000883f70: 00 01 23 a4 ldq t0,256(t2) fffffc0000883f74: f0 02 01 a6 ldq a0,752(t0) fffffc0000883f78: 08 a1 7d a7 ldq t12,-24312(gp) [...] The ldl_l .... stl_c sequence can be identified as test_and_clear_bit() on alpha. So the faulting instruction is this line of fs/ext3/inode.c::ext3_bmap() : if (test_and_clear_bit(EXT3_STATE_JDATA, &inode->u.ext3_i.i_state)) In fact ext3_i.i_state is a 16 bit aligned 16 bit value while test_and_clear_bit() expects to work on aligned 32 bit quantities. Furthermore the unaligned trap handler doesn't know how to handle the ldl_l. How to fix it? Weird side note: ext3 0.0.7 on kernel 2.4.5-ac22 worked without problems (as in : mount the filesystem as ext3 and use it for some compilations) Please CC: dl8bcu@gmx.net on replies as I'm not on this list. Bye, Thorsten -- | Thorsten Kranzkowski Internet: dl8bcu@gmx.net | | Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany | | Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |
Thorsten Kranzkowski wrote:> > So the faulting instruction is this line of fs/ext3/inode.c::ext3_bmap() : > > if (test_and_clear_bit(EXT3_STATE_JDATA, &inode->u.ext3_i.i_state)) >Great, thanks. Could you please change i_state to __u32 in ext3_fs_i.h? If that works, I'll put out 0.9.1.
Thorsten Kranzkowski
2001-Jul-07 17:40 UTC
Re: Bad unaligned kernel access with ext3 0.8.0
Ok, the __u32 did it. instead of the unaligned acces I do see now Jul 7 17:35:28 Marvin kernel: [EXT3 FS 2.4-0.9.0, 5 Jul 2001, bs=4096, gc=17, bpg=32768, ipg=16224, mo=0800] Jul 7 17:35:28 Marvin kernel: EXT3-fs: mounted filesystem with ordered data mode. which looks a lot better :-) Thanks, Thorsten -- | Thorsten Kranzkowski Internet: dl8bcu@gmx.net | | Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany | | Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |