linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
@ 2005-01-27  7:24 Sergey S. Kostyliov
  2005-01-27 10:17 ` Vladimir Saveliev
  0 siblings, 1 reply; 7+ messages in thread
From: Sergey S. Kostyliov @ 2005-01-27  7:24 UTC (permalink / raw)
  To: reiserfs-list; +Cc: linux-kernel, admin

Hello all,

Here is a BUG() I've just hited on quota enabled reiserfs disk.

rathamahata@dev rathamahata $ mount | grep /dev/sdb2
/dev/sdb2 on /var/www type reiserfs (rw,noatime,nodiratime,data=writeback,grpquota,usrquota)
rathamahata@dev rathamahata $

REISERFS: panic (device sdb2): journal_begin called without kernel lock held
------------[ cut here ]------------
kernel BUG at fs/reiserfs/prints.c:362!
invalid operand: 0000 [#1]
PREEMPT SMP
Modules linked in:
CPU:    0
EIP:    0060:[<c019e9fb>]    Not tainted VLI
EFLAGS: 00010296   (2.6.11-rc2)
EIP is at reiserfs_panic+0x4b/0x80
eax: 00000050   ebx: c02b75b2   ecx: f7fe4270   edx: f1034e38
esi: f7543600   edi: f7543770   ebp: 000000f2   esp: f1034e34
ds: 007b   es: 007b   ss: 0068
Process qmail-local (pid: 10803, threadinfo=f1034000 task=cc440a60)
Stack: c02bbb00 f7543770 c03b89c0 f7543600 f1034ecc f89af000 c01a8a0e f7543600
       c02bcf20 c02b7db8 c01ac186 f74b66c0 000000f2 f1034ecc c0167403 f74b6900
       c02f2740 fffffff4 f74b6960 00295e98 c01679dc 00295e98 f74b6090 f74b66c0
Call Trace:
 [<c01a8a0e>] reiserfs_check_lock_depth+0x2e/0x30
 [<c01ac186>] do_journal_begin_r+0x26/0x2d0
 [<c0167403>] d_alloc+0x133/0x180
 [<c01679dc>] __d_lookup+0x11c/0x130
 [<c01ac641>] journal_begin+0x61/0xf0
 [<c019d445>] reiserfs_dquot_initialize+0x25/0x60
 [<c015db2d>] link_path_walk+0x48d/0xd20
 [<c015d1c6>] permission+0x76/0xa0
 [<c015ea98>] vfs_create+0xc8/0x110
 [<c015f2cf>] open_namei+0x57f/0x5d0
 [<c014fcfd>] filp_open+0x2d/0x60
 [<c0150014>] get_unused_fd+0x94/0xc0
 [<c015cff7>] getname+0x67/0xb0
 [<c015012c>] sys_open+0x3c/0x80
 [<c01026b1>] sysenter_past_esp+0x52/0x75
Code: 8d be 70 01 00 00 e8 a5 fd ff ff c7 04 24 00 bb 2b c0 85 f6 89 d8 0f 45 c7 ba c0 893b c0 89 54 24 08 89 44 24 04 e8 25 9d f7 ff <0f> 0b 6a 01 1a 7b 2b c0 c7 04 24 40 bb 2b c0 85 f6 be c0 89 3b
 <0>REISERFS: panic (device sdb2): journal_begin called without kernel lock held
------------[ cut here ]------------

-- 
Sergey S. Kostyliov <rathamahata@ehouse.ru>
Jabber ID: rathamahata@jabber.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
  2005-01-27  7:24 [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362 Sergey S. Kostyliov
@ 2005-01-27 10:17 ` Vladimir Saveliev
  2005-01-27 11:26   ` Jan Kara
  2005-01-27 12:52   ` Sergey S. Kostyliov
  0 siblings, 2 replies; 7+ messages in thread
From: Vladimir Saveliev @ 2005-01-27 10:17 UTC (permalink / raw)
  To: Sergey S. Kostyliov; +Cc: reiserfs-list, linux-kernel, admin

[-- Attachment #1: Type: text/plain, Size: 2162 bytes --]

Hello

On Thu, 2005-01-27 at 10:24, Sergey S. Kostyliov wrote:
> Hello all,
> 
> Here is a BUG() I've just hited on quota enabled reiserfs disk.
> 
> rathamahata@dev rathamahata $ mount | grep /dev/sdb2
> /dev/sdb2 on /var/www type reiserfs (rw,noatime,nodiratime,data=writeback,grpquota,usrquota)
> rathamahata@dev rathamahata $
> 
> REISERFS: panic (device sdb2): journal_begin called without kernel lock held

Would you check whether this patch helps, please?


> ------------[ cut here ]------------
> kernel BUG at fs/reiserfs/prints.c:362!
> invalid operand: 0000 [#1]
> PREEMPT SMP
> Modules linked in:
> CPU:    0
> EIP:    0060:[<c019e9fb>]    Not tainted VLI
> EFLAGS: 00010296   (2.6.11-rc2)
> EIP is at reiserfs_panic+0x4b/0x80
> eax: 00000050   ebx: c02b75b2   ecx: f7fe4270   edx: f1034e38
> esi: f7543600   edi: f7543770   ebp: 000000f2   esp: f1034e34
> ds: 007b   es: 007b   ss: 0068
> Process qmail-local (pid: 10803, threadinfo=f1034000 task=cc440a60)
> Stack: c02bbb00 f7543770 c03b89c0 f7543600 f1034ecc f89af000 c01a8a0e f7543600
>        c02bcf20 c02b7db8 c01ac186 f74b66c0 000000f2 f1034ecc c0167403 f74b6900
>        c02f2740 fffffff4 f74b6960 00295e98 c01679dc 00295e98 f74b6090 f74b66c0
> Call Trace:
>  [<c01a8a0e>] reiserfs_check_lock_depth+0x2e/0x30
>  [<c01ac186>] do_journal_begin_r+0x26/0x2d0
>  [<c0167403>] d_alloc+0x133/0x180
>  [<c01679dc>] __d_lookup+0x11c/0x130
>  [<c01ac641>] journal_begin+0x61/0xf0
>  [<c019d445>] reiserfs_dquot_initialize+0x25/0x60
>  [<c015db2d>] link_path_walk+0x48d/0xd20
>  [<c015d1c6>] permission+0x76/0xa0
>  [<c015ea98>] vfs_create+0xc8/0x110
>  [<c015f2cf>] open_namei+0x57f/0x5d0
>  [<c014fcfd>] filp_open+0x2d/0x60
>  [<c0150014>] get_unused_fd+0x94/0xc0
>  [<c015cff7>] getname+0x67/0xb0
>  [<c015012c>] sys_open+0x3c/0x80
>  [<c01026b1>] sysenter_past_esp+0x52/0x75
> Code: 8d be 70 01 00 00 e8 a5 fd ff ff c7 04 24 00 bb 2b c0 85 f6 89 d8 0f 45 c7 ba c0 893b c0 89 54 24 08 89 44 24 04 e8 25 9d f7 ff <0f> 0b 6a 01 1a 7b 2b c0 c7 04 24 40 bb 2b c0 85 f6 be c0 89 3b
>  <0>REISERFS: panic (device sdb2): journal_begin called without kernel lock held
> ------------[ cut here ]------------

[-- Attachment #2: reiserfs-quota-add-missing-lock_kernel.patch --]
[-- Type: text/plain, Size: 2707 bytes --]

 fs/reiserfs/super.c |   12 ++++++++++++
 1 files changed, 12 insertions(+)

diff -puN fs/reiserfs/super.c~reiserfs-quota-add-missing-lock_kernel fs/reiserfs/super.c
--- linux-2.6.11-rc2/fs/reiserfs/super.c~reiserfs-quota-add-missing-lock_kernel	2005-01-27 13:09:35.101322376 +0300
+++ linux-2.6.11-rc2-root/fs/reiserfs/super.c	2005-01-27 13:15:19.608949256 +0300
@@ -1835,9 +1835,11 @@ static int reiserfs_dquot_initialize(str
     int ret;
 
     /* We may create quota structure so we need to reserve enough blocks */
+    reiserfs_write_lock(inode->i_sb);
     journal_begin(&th, inode->i_sb, 2*REISERFS_QUOTA_INIT_BLOCKS);
     ret = dquot_initialize(inode, type);
     journal_end(&th, inode->i_sb, 2*REISERFS_QUOTA_INIT_BLOCKS);
+    reiserfs_write_unlock(inode->i_sb);
     return ret;
 }
 
@@ -1847,9 +1849,11 @@ static int reiserfs_dquot_drop(struct in
     int ret;
 
     /* We may delete quota structure so we need to reserve enough blocks */
+    reiserfs_write_lock(inode->i_sb);
     journal_begin(&th, inode->i_sb, 2*REISERFS_QUOTA_INIT_BLOCKS);
     ret = dquot_drop(inode);
     journal_end(&th, inode->i_sb, 2*REISERFS_QUOTA_INIT_BLOCKS);
+    reiserfs_write_unlock(inode->i_sb);
     return ret;
 }
 
@@ -1858,9 +1862,11 @@ static int reiserfs_write_dquot(struct d
     struct reiserfs_transaction_handle th;
     int ret;
 
+    reiserfs_write_lock(dquot->dq_sb);
     journal_begin(&th, dquot->dq_sb, REISERFS_QUOTA_TRANS_BLOCKS);
     ret = dquot_commit(dquot);
     journal_end(&th, dquot->dq_sb, REISERFS_QUOTA_TRANS_BLOCKS);
+    reiserfs_write_unlock(dquot->dq_sb);
     return ret;
 }
 
@@ -1869,9 +1875,11 @@ static int reiserfs_acquire_dquot(struct
     struct reiserfs_transaction_handle th;
     int ret;
 
+    reiserfs_write_lock(dquot->dq_sb);
     journal_begin(&th, dquot->dq_sb, REISERFS_QUOTA_INIT_BLOCKS);
     ret = dquot_acquire(dquot);
     journal_end(&th, dquot->dq_sb, REISERFS_QUOTA_INIT_BLOCKS);
+    reiserfs_write_unlock(dquot->dq_sb);
     return ret;
 }
 
@@ -1880,9 +1888,11 @@ static int reiserfs_release_dquot(struct
     struct reiserfs_transaction_handle th;
     int ret;
 
+    reiserfs_write_lock(dquot->dq_sb);
     journal_begin(&th, dquot->dq_sb, REISERFS_QUOTA_INIT_BLOCKS);
     ret = dquot_release(dquot);
     journal_end(&th, dquot->dq_sb, REISERFS_QUOTA_INIT_BLOCKS);
+    reiserfs_write_unlock(dquot->dq_sb);
     return ret;
 }
 
@@ -1904,9 +1914,11 @@ static int reiserfs_write_info(struct su
     int ret;
 
     /* Data block + inode block */
+    reiserfs_write_lock(sb);
     journal_begin(&th, sb, 2);
     ret = dquot_commit_info(sb, type);
     journal_end(&th, sb, 2);
+    reiserfs_write_unlock(sb);
     return ret;
 }
 

_

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
  2005-01-27 10:17 ` Vladimir Saveliev
@ 2005-01-27 11:26   ` Jan Kara
  2005-01-27 14:15     ` Vladimir Saveliev
  2005-01-27 12:52   ` Sergey S. Kostyliov
  1 sibling, 1 reply; 7+ messages in thread
From: Jan Kara @ 2005-01-27 11:26 UTC (permalink / raw)
  To: Vladimir Saveliev; +Cc: Sergey S. Kostyliov, reiserfs-list, linux-kernel, admin

  Hello,

> On Thu, 2005-01-27 at 10:24, Sergey S. Kostyliov wrote:
> > Hello all,
> > 
> > Here is a BUG() I've just hited on quota enabled reiserfs disk.
> > 
> > rathamahata@dev rathamahata $ mount | grep /dev/sdb2
> > /dev/sdb2 on /var/www type reiserfs (rw,noatime,nodiratime,data=writeback,grpquota,usrquota)
> > rathamahata@dev rathamahata $
> > 
> > REISERFS: panic (device sdb2): journal_begin called without kernel lock held
> 
> Would you check whether this patch helps, please?
  BTW: What are the exact rules where lock_kernel() should be held for
reiserfs? Is there a doc somewhere? I suspect we might need the lock
also for reiserfs_quota_read() (reiserfs_quota_write() should be
already protected by your fix).
  Hmm, I should also check ext2/ext3 whether it needs the lock...

								Honza

-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
  2005-01-27 10:17 ` Vladimir Saveliev
  2005-01-27 11:26   ` Jan Kara
@ 2005-01-27 12:52   ` Sergey S. Kostyliov
  1 sibling, 0 replies; 7+ messages in thread
From: Sergey S. Kostyliov @ 2005-01-27 12:52 UTC (permalink / raw)
  To: Vladimir Saveliev; +Cc: reiserfs-list, linux-kernel, admin

On Thursday 27 January 2005 13:17, Vladimir Saveliev wrote:
> Hello
> 
> On Thu, 2005-01-27 at 10:24, Sergey S. Kostyliov wrote:
> > Hello all,
> > 
> > Here is a BUG() I've just hited on quota enabled reiserfs disk.
> > 
> > rathamahata@dev rathamahata $ mount | grep /dev/sdb2
> > /dev/sdb2 on /var/www type reiserfs (rw,noatime,nodiratime,data=writeback,grpquota,usrquota)
> > rathamahata@dev rathamahata $
> > 
> > REISERFS: panic (device sdb2): journal_begin called without kernel lock held
> 
> Would you check whether this patch helps, please?
That fixes it. Thank you!

-- 
Sergey S. Kostyliov <rathamahata@ehouse.ru>
Jabber ID: rathamahata@jabber.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
  2005-01-27 11:26   ` Jan Kara
@ 2005-01-27 14:15     ` Vladimir Saveliev
  2005-01-27 15:06       ` Jan Kara
  2005-01-28 21:53       ` Lee Revell
  0 siblings, 2 replies; 7+ messages in thread
From: Vladimir Saveliev @ 2005-01-27 14:15 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-kernel

Hello

On Thu, 2005-01-27 at 14:26, Jan Kara wrote:
>   Hello,
> 
> > On Thu, 2005-01-27 at 10:24, Sergey S. Kostyliov wrote:
> > > Hello all,
> > > 
> > > Here is a BUG() I've just hited on quota enabled reiserfs disk.
> > > 
> > > rathamahata@dev rathamahata $ mount | grep /dev/sdb2
> > > /dev/sdb2 on /var/www type reiserfs (rw,noatime,nodiratime,data=writeback,grpquota,usrquota)
> > > rathamahata@dev rathamahata $
> > > 
> > > REISERFS: panic (device sdb2): journal_begin called without kernel lock held
> > 
> > Would you check whether this patch helps, please?
>   BTW: What are the exact rules where lock_kernel() should be held for
> reiserfs? Is there a doc somewhere? 
I do not think so.
Earlier reiserfs used to lock_kernel on entering and unlock on exit. The
reason is that reiserfs has no fine grain locking protecting access to
its data structures.
Since that time there could be introduced some minor improvements,
though.

> I suspect we might need the lock
> also for reiserfs_quota_read() (reiserfs_quota_write() should be
> already protected by your fix).
>   Hmm, I should also check ext2/ext3 whether it needs the lock...
> 
> 								Honza


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
  2005-01-27 14:15     ` Vladimir Saveliev
@ 2005-01-27 15:06       ` Jan Kara
  2005-01-28 21:53       ` Lee Revell
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Kara @ 2005-01-27 15:06 UTC (permalink / raw)
  To: Vladimir Saveliev; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

  Hi!

> On Thu, 2005-01-27 at 14:26, Jan Kara wrote:
> >   Hello,
> > 
> > > On Thu, 2005-01-27 at 10:24, Sergey S. Kostyliov wrote:
> > > > Hello all,
> > > > 
> > > > Here is a BUG() I've just hited on quota enabled reiserfs disk.
> > > > 
> > > > rathamahata@dev rathamahata $ mount | grep /dev/sdb2
> > > > /dev/sdb2 on /var/www type reiserfs (rw,noatime,nodiratime,data=writeback,grpquota,usrquota)
> > > > rathamahata@dev rathamahata $
> > > > 
> > > > REISERFS: panic (device sdb2): journal_begin called without kernel lock held
> > > 
> > > Would you check whether this patch helps, please?
> >   BTW: What are the exact rules where lock_kernel() should be held for
> > reiserfs? Is there a doc somewhere? 
> I do not think so.
> Earlier reiserfs used to lock_kernel on entering and unlock on exit. The
> reason is that reiserfs has no fine grain locking protecting access to
> its data structures.
> Since that time there could be introduced some minor improvements,
> though.
  So in that case reiserfs_quota_read() also needs a BKL
because it can be called from the quota code without any lock
guarantees (e.g. quota_on() and quotactl() can call reading routine
without BKL).
  Attached patch adds this BKL locking and adds also missing
lock_buffer() I found.
  If you agree with the patch then you can forward it to Andrew/Linus.

								Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

[-- Attachment #2: reiser-lock-fix.diff --]
[-- Type: text/plain, Size: 1034 bytes --]

Add missing locking to reiserfs_quota_read() and reiserfs_quota_write().

Signed-off-by: Jan Kara <jack@suse.cz>

--- linux/fs/reiserfs/super.c	2005-01-27 12:56:27.000000000 +0100
+++ linux/fs/reiserfs/super.c	2005-01-27 17:41:20.000000000 +0100
@@ -1993,7 +1993,9 @@ static ssize_t reiserfs_quota_read(struc
 	tocopy = sb->s_blocksize - offset < toread ? sb->s_blocksize - offset : toread;
 	tmp_bh.b_state = 0;
 	/* Quota files are without tails so we can safely use this function */
+	reiserfs_write_lock(sb);
 	err = reiserfs_get_block(inode, blk, &tmp_bh, 0);
+	reiserfs_write_unlock(sb);
 	if (err)
 	    return err;
 	if (!buffer_mapped(&tmp_bh))    /* A hole? */
@@ -2041,8 +2043,11 @@ static ssize_t reiserfs_quota_write(stru
 	    err = -EIO;
 	    goto out;
 	}
+	lock_buffer(bh);
 	memcpy(bh->b_data+offset, data, tocopy);
+	flush_dcache_page(bh->b_page);
 	set_buffer_uptodate(bh);
+	unlock_buffer(bh);
 	reiserfs_prepare_for_journal(sb, bh, 1);
 	journal_mark_dirty(current->journal_info, sb, bh);
 	if (!journal_quota)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362
  2005-01-27 14:15     ` Vladimir Saveliev
  2005-01-27 15:06       ` Jan Kara
@ 2005-01-28 21:53       ` Lee Revell
  1 sibling, 0 replies; 7+ messages in thread
From: Lee Revell @ 2005-01-28 21:53 UTC (permalink / raw)
  To: Vladimir Saveliev; +Cc: Jan Kara, linux-kernel

On Thu, 2005-01-27 at 17:15 +0300, Vladimir Saveliev wrote:
> Earlier reiserfs used to lock_kernel on entering and unlock on exit. The
> reason is that reiserfs has no fine grain locking protecting access to
> its data structures.
> Since that time there could be introduced some minor improvements,
> though.

No, reiser3 still does not have proper locking.  It uses the BKL for
everything.  This will not be fixed as reiser3 is in maintenance mode.
According to Hans "the fix is reiser4".

This came up early in the voluntary preemption development process, we
found reiser3 to be unusable for low latency audio due to the excessive
BKL use disabling preemption all over the place.

It would be interesting to test reiser3 with the preemptible BKL
enabled.

Lee  


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-01-28 21:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-27  7:24 [2.6.11-rc2] kernel BUG at fs/reiserfs/prints.c:362 Sergey S. Kostyliov
2005-01-27 10:17 ` Vladimir Saveliev
2005-01-27 11:26   ` Jan Kara
2005-01-27 14:15     ` Vladimir Saveliev
2005-01-27 15:06       ` Jan Kara
2005-01-28 21:53       ` Lee Revell
2005-01-27 12:52   ` Sergey S. Kostyliov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).