Skip to contentSkip to conversation

reiser4 crash

DISCUSSION Andrew Benton 3 participants 5 messages Dec 4, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

I've been using reiser4 for a couple of months. A couple of days ago I did something stupid with Abiword, the disk started thrashing and as the system crashed it left this on the screen

------------[ cut here ]------------
kernel BUG at fs/reiser4/plugin/file/tail_conversion.c:58!
invalid operand:0000 [#1]
SMP
Modules linked in: nvidia
CPU:    0
EIP:    0060:[<c020144e>]    Tainted: P      VLI
EFLAGS: 00010282   (2.6.10-rc2-bk13)

EIP is at get_nonexclusive_access+0x29/0x33
eax: df033eac ebx: df032000 ecx: d96fee80 edx: de5a70dc
esi: 00000000 edi: de5a70dc ebp: de5a7144 esp:df033d84
ds: 007b es: 007b ss: 0068
Process syslogd (pid: 1488, threadinfo=df032000 task=df7df020)

Stack: c0200633 de5a70dc 0804dcc7 00000001 00000001 df033bdc 00000000
df032000
       00000000 00000001 00000001 00000001 00000000 00000001 00000001
c13a0a40
       de91d144 de91d10c c0200183 df033ddc 0804b000 c01c0492 d96fee80
00101cca
Call Trace:
[<c0200633>] write_unix_file+0x2a1/0x45b
[<c0200183>] unix_file_filemap_nopage+0xaa/0xcf
[<c01c0492>] atom_should_commit+0x5a/0x60
[<c01bd241>] init_context+0x75/0xb4
[<c01d3f46>] reiser4_write+0x8f/0xfc
[<c0261e36>] copy_from_user+0x42/0x70
[<c01524b0>] do_readv_writev+0x170/0x29a
[<c01d3eb7>] reiser4_write+0x0/0xfc
[<c037515f>] sys_recv+0x37/0x3b
[<c015268e>] vfs_writev+0x58/0x5c
[<c0152763>] sys_writev+0x51/0x80
[<c010264d>] sysenter_past_esp+0x52/0x71
Code: 00 c3 b8 00 e0 ff ff 21 e0 8b 00 8b 80 d4 04 00 00 8b 54 24 04 8b 40 44 8b 48 0c 85 c9 75 0c 89 d0 f0 ff 00 0f 88 b8 11 00 00 c3 <0f> 0b 3a 00 e4 58 43 c0 eb ea 8b 44 24 04 ba ff ff ff ff f0 0f

To me this looked very similar to http://www.uwsg.iu.edu/hypermail/linux/kernel/0411.3/0493.html so I applied Vladimir Saveliev's patch, recompiled and the patch seems to have done the trick.

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/11/23 14:07:34+03:00 vs@xxxxxxxxxxxxxxxxxxxxx # read_unix_file: missing calls to txn_restart() are added #

# plugin/file/file.c
# 2004/11/23 14:07:31+03:00 vs@xxxxxxxxxxxxxxxxxxxxx +4 -1
# read_unix_file: missing calls to txn_restart() are added
#
diff -Nru a/plugin/file/file.c b/plugin/file/file.c
--- a/plugin/file/file.c 2004-11-23 14:45:34 +03:00
+++ b/plugin/file/file.c 2004-11-23 14:45:34 +03:00
@@ -1741,6 +1741,8 @@
while (left > 0) {
size_t to_read;

+ txn_restart_current();
+
size = i_size_read(inode);
if (*off >= size)
/* position to read from is past the end of file */ @@ -1774,7 +1776,6 @@
if (user_space) reiser4_put_user_pages(pages, nr_pages); drop_nonexclusive_access(uf_info);
- txn_restart_current();

if (read < 0) {
result = read;
@@ -1974,6 +1975,8 @@

drop_nonexclusive_access(unix_file_inode_data(inode)); up_read(&reiser4_inode_data(inode)->coc_sem); +
+ txn_restart_current();

reiser4_exit_context(&ctx);
return page;

Now if I give Abiword further abuse, memory fills, the disk thrashes but when the swap partition is about half full Abiword caves and the system recovers.

#1 lore raw
Quoted 3 lines · Andrew Benton

I've been using reiser4 for a couple of months. A couple of days ago I did something stupid with Abiword, the disk started thrashing and as the system crashed it left this on the screen

You need that patch.

usr/src/linux-2.6.10-rc2-mm4-jedi1/fs/reiser4/plugin/file/file.c renamed from fs/reiser4/plugin/file/file.c +4 -1
diff -urN linux-2.6.10-rc2-mm4/fs/reiser4/plugin/file/file.c /usr/src/linux-2.6.10-rc2-mm4-jedi1/fs/reiser4/plugin/file/file.c
@@ -1741,6 +1741,8 @@
 	while (left > 0) {
 		size_t to_read;		
 
+		txn_restart_current();
+
 		size = i_size_read(inode);
 		if (*off >= size)
 			/* position to read from is past the end of file */
@@ -1774,7 +1776,6 @@
 		if (user_space)
 			reiser4_put_user_pages(pages, nr_pages);
 		drop_nonexclusive_access(uf_info);
-		txn_restart_current();
 
 		if (read < 0) {
 			result = read;
@@ -1975,6 +1976,8 @@
 	drop_nonexclusive_access(unix_file_inode_data(inode));
 	up_read(&reiser4_inode_data(inode)->coc_sem);
 
+	txn_restart_current();
+
 	reiser4_exit_context(&ctx);
 	return page;
 }

--
Frank - my stupid blog: http://00f.net

#3 lore raw
In reply to Andrew Benton
Quoted 3 lines · Andrew Benton

I've been using reiser4 for a couple of months. A couple of days ago I did something stupid with Abiword, the disk started thrashing and as the system crashed it left this on the screen

<snipped>

Which if you are trying to patch this against the current
Namesys 2.6.10-rc1 patches requires Saveliev's previous patch from a couple of weeks ago which I've also attached to this thread now as I'm in the middle of upgrading to 2.6.10-rc3 and had to go looking for the previous patch myself. :)

Signature · 19 lines
Mark Nipper                                                e-contacts:
4475 Carter Creek Parkway                           [email protected]
Apartment 724                               http://nipsy.bitgnome.net/
Bryan, Texas, 77802-4481           AIM/Yahoo: texasnipsy ICQ: 66971617
(979)575-3193                                      MSN: [email protected]

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GG/IT d- s++:+ a- C++$ UBL++++$ P--->+++ L+++$ !E---
W++(--) N+ o K++ w(---) O++ M V(--) PS+++(+) PE(--)
Y+ PGP t+ 5 X R tv b+++@ DI+(++) D+ G e h r++ y+(**)
------END GEEK CODE BLOCK------

---begin random quote of the moment---
"I know the forces of spontaneous, emergent life are stronger
than the forces of evil, repression and death, and the forces of
death will destroy themselves."
 -- William S. Burroughs
----end random quote of the moment----

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/11/15 16:23:47+03:00 [email protected]
# unix_file_filemap_nopage: missing context creation is added
#

# plugin/file/file.c
#   2004/11/15 16:23:45+03:00 [email protected] +5 -1
#   unix_file_filemap_nopage: missing context creation is added
# 
diff -Nru a/plugin/file/file.c b/plugin/file/file.c
--- a/plugin/file/file.c	2004-11-17 09:36:11 +03:00
+++ b/plugin/file/file.c	2004-11-17 09:36:11 +03:00
@@ -1961,8 +1961,10 @@
 {
 	struct page *page;
 	struct inode *inode;
-
+	reiser4_context ctx;
+	
 	inode = area->vm_file->f_dentry->d_inode;
+	init_context(&ctx, inode->i_sb);

/* block filemap_nopage if copy on capture is processing with a node of this file */ down_read(&reiser4_inode_data(inode)->coc_sem);
@@ -1972,6 +1974,8 @@

drop_nonexclusive_access(unix_file_inode_data(inode)); up_read(&reiser4_inode_data(inode)->coc_sem);
+
+ reiser4_exit_context(&ctx);
return page;
}

#4 lore raw
Quoted 5 lines · Mark Nipper

<snipped>

Which if you are trying to patch this against the current
Namesys 2.6.10-rc1 patches requires Saveliev's previous patch from a couple of weeks ago

Yes, that patch is in the current 2.6.10-rc2-mm4 patch. The fix, however, isn't.