mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Tomas <bzzz@tmi.comex.ru>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@digeo.com>,
	ext2-devel@lists.sourceforge.net, Alex Tomas <bzzz@tmi.comex.ru>
Subject: [RFC] probably invalid accounting in jbd
Date: Fri, 23 May 2003 11:20:31 +0000	[thread overview]
Message-ID: <871xypx62o.fsf_-_@gw.home.net> (raw)
In-Reply-To: <20030521093848.59ada625.akpm@digeo.com> (Andrew Morton's message of "Wed, 21 May 2003 09:38:48 -0700")


hi!

I think current journal_release_buffer() which is used by ext3 allocator
in -mm tree has a bug. look, it won't decrement credits if concurrent
thread already put buffer on metadata list. but this may ext3_try_to_allocate()
may overflow handle's credist.
so, jbd will hit J_ASSERT_JH(jh, handle->h_buffer_credits > 0) somewhere


void journal_release_buffer (handle_t *handle, struct buffer_head *bh)
{
        .....
        if (jh->b_jlist == BJ_Reserved && jh->b_transaction == transaction &&
            !buffer_jdirty(jh2bh(jh))) {
                JBUFFER_TRACE(jh, "unused: refiling it");
                handle->h_buffer_credits++;
                __journal_refile_buffer(jh);
        }
        ....
}


here is the patch against 2.5.69-mm6:

diff -puNr linux-2.5.69-mm6/fs/jbd/transaction.c edited/fs/jbd/transaction.c
--- linux-2.5.69-mm6/fs/jbd/transaction.c	Fri May 16 18:03:20 2003
+++ b_commited_data-race/fs/jbd/transaction.c	Fri May 23 11:10:21 2003
@@ -1146,10 +1146,10 @@ void journal_release_buffer (handle_t *h
 	if (jh->b_jlist == BJ_Reserved && jh->b_transaction == transaction &&
 	    !buffer_jdirty(jh2bh(jh))) {
 		JBUFFER_TRACE(jh, "unused: refiling it");
-		handle->h_buffer_credits++;
 		__journal_refile_buffer(jh);
 	}
 	spin_unlock(&journal_datalist_lock);
+	handle->h_buffer_credits++;
 
 	JBUFFER_TRACE(jh, "exit");
 	unlock_journal(journal);


  parent reply	other threads:[~2003-05-23  7:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-18 17:21 [RFC] probably bug in current ext3/jbd Alex Tomas
2003-05-19 20:34 ` [Ext2-devel] " Stephen C. Tweedie
2003-05-20  0:46   ` Alex Tomas
2003-05-19 20:51     ` Stephen C. Tweedie
2003-05-20  0:58       ` Alex Tomas
2003-05-20 16:06       ` Alex Tomas
2003-05-21 16:38         ` Andrew Morton
2003-05-21 20:45           ` Alex Tomas
2003-05-21 16:59             ` Andrew Morton
     [not found]               ` <m3brxwe2lr.fsf@lexa.home.net>
     [not found]                 ` <20030521103737.52eddeb3.akpm@digeo.com>
     [not found]                   ` <87n0hgc6s6.fsf@gw.home.net>
     [not found]                     ` <20030521105011.2d316baf.akpm@digeo.com>
     [not found]                       ` <87k7ckc5z2.fsf@gw.home.net>
     [not found]                         ` <20030521143140.3aaa86ba.akpm@digeo.com>
2003-05-23 11:08                           ` Alex Tomas
2003-05-23  8:49                             ` Andrew Morton
2003-05-23 12:49                               ` Alex Tomas
2003-05-23 11:20           ` Alex Tomas [this message]
2003-05-23  8:26             ` [RFC] probably invalid accounting in jbd Andrew Morton
2003-05-23 16:02               ` [Ext2-devel] " Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871xypx62o.fsf_-_@gw.home.net \
    --to=bzzz@tmi.comex.ru \
    --cc=akpm@digeo.com \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®