Skip to contentSkip to conversation

2.6.0-test2: resiserfs BUG on Alt-SysRq-U

DISCUSSION Andrey Borzenkov 2 participants 3 messages Aug 4, 2003 – Aug 5, 2003

lore
Share & tools
lore
#0 lore raw

this has been around since 2.5.75 at least and may be before it as well.

-andrey

sh-2.05b# SysRq : Emergency Remount R/O

------------[ cut here ]------------
kernel BUG at fs/reiserfs/journal.c:409!
invalid operand: 0000 [#1]
CPU:    0
EIP:    0060:[<d187081a>]    Not tainted
EFLAGS: 00010246

EIP is at reiserfs_check_lock_depth+0x2a/0x40 [reiserfs]
eax: 00000000 ebx: cf369004 ecx: 00000000 edx: ffffcc00
esi: cf369004 edi: cf721f78 ebp: cf721eb4 esp: cf721eac
ds: 007b es: 007b ss: 0068
Process pdflush (pid: 7, threadinfo=cf720000 task=cf749000)

Stack: d187bae0 d187ecb3 cf721ef0 d187375e d187ecb3 3f2e87df 00000000 00000000
       d187e847 00000077 00000000 00000000 00000000 00000000 cf369004 cf28d000
       cf721f78 cf721f08 d1873a46 cf721f24 cf369004 0000000a 00000000 cf721f50
Call Trace:
 [<d187375e>] do_journal_begin_r+0x1e/0x2d0 [reiserfs]
 [<d1873a46>] journal_begin+0x16/0x20 [reiserfs]
 [<d1864310>] reiserfs_remount+0xb0/0x1d0 [reiserfs]
 [<c01662fe>] sync_blockdev+0x2e/0x40
 [<c016c4ec>] do_remount_sb+0xac/0x110
 [<c016c6b6>] do_emergency_remount+0x166/0x1b0
 [<c01494fe>] __pdflush+0x16e/0x390
 [<c011f37f>] schedule_tail+0xbf/0xe0
 [<c0149720>] pdflush+0x0/0x20
 [<c014972f>] pdflush+0xf/0x20
 [<c016c550>] do_emergency_remount+0x0/0x1b0
 [<c0109029>] kernel_thread_helper+0x5/0xc

Code: 0f 0b 99 01 d9 eb 87 d1 58 5a eb dd 8d 76 00 8d bc 27 00 00
#1 lore raw

Hello!

Quoted 2 lines · Andrey Borzenkov

this has been around since 2.5.75 at least and may be before it as well. kernel BUG at fs/reiserfs/journal.c:409!

Hm, indeed.
So they are calling ->remount() without lock_kernel these days. The patch below should help, please verify.

Thank you.

Bye,
Oleg
===== fs/reiserfs/super.c 1.66 vs edited =====

fs/reiserfs/super.c +12 -3
@@ -761,6 +761,7 @@
   if (!reiserfs_parse_options(s, arg, &mount_options, &blocks, NULL))
     return -EINVAL;
   
+  reiserfs_write_lock(s);
   handle_attrs(s);
 
   /* Add options that are safe here */
@@ -778,17 +779,22 @@
 
   if(blocks) {
     int rc = reiserfs_resize(s, blocks);
-    if (rc != 0)
+    if (rc != 0) {
+      reiserfs_write_unlock(s);
       return rc;
+    }
   }
 
   if (*mount_flags & MS_RDONLY) {
     /* remount read-only */
-    if (s->s_flags & MS_RDONLY)
+    if (s->s_flags & MS_RDONLY) {
       /* it is read-only already */
+      reiserfs_write_unlock(s);
       return 0;
+    }
     /* try to remount file system with read-only permissions */
     if (sb_umount_state(rs) == REISERFS_VALID_FS || REISERFS_SB(s)->s_mount_state != REISERFS_VALID_FS) {
+      reiserfs_write_unlock(s);
       return 0;
     }
 
@@ -800,8 +806,10 @@
     s->s_dirt = 0;
   } else {
     /* remount read-write */
-    if (!(s->s_flags & MS_RDONLY))
+    if (!(s->s_flags & MS_RDONLY)) {
+        reiserfs_write_unlock(s);
 	return 0; /* We are read-write already */
+    }
 
     REISERFS_SB(s)->s_mount_state = sb_umount_state(rs) ;
     s->s_flags &= ~MS_RDONLY ; /* now it is safe to call journal_begin */
@@ -824,6 +832,7 @@
   if (!( *mount_flags & MS_RDONLY ) )
     finish_unfinished( s );
 
+  reiserfs_write_unlock(s);
   return 0;
 }
 
#2 lore raw
Quoted 10 lines · Oleg Drokin

Hello!

Quoted 2 lines · Andrey Borzenkov

this has been around since 2.5.75 at least and may be before it as well. kernel BUG at fs/reiserfs/journal.c:409!

Hm, indeed.
So they are calling ->remount() without lock_kernel these days. The patch below should help, please verify.

yes, it seems to have fixed it.