From: Josef Bacik <jbacik@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: Josef Bacik <jbacik@redhat.com>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix panic in jbd by adding locks
Date: Tue, 21 Aug 2007 11:43:12 -0400 [thread overview]
Message-ID: <20070821154311.GE27557@dhcp-243-37.rdu.redhat.com> (raw)
In-Reply-To: <20070820152021.GF3784@duck.suse.cz>
On Mon, Aug 20, 2007 at 05:20:21PM +0200, Jan Kara wrote:
> OK, thanks. So record probably points to an already freed memory which has
> been overwritten by garbage...
>
> > > Thanks for details. I'm still not convinced. What they essentially
> > > write is that slab cache revoke_record_cache is not guarded by any spin
> > > lock. It's not and that should be fine as slab caches are SMP safe by
> > > themselves.
> >
> > No its the list_del thats not gaurded, so the hash list gets screwed up outside
> > of a lock. If there are other problems that need to be addressed then ok, but I
> > still think that we should be protecting all of the list traversal/changing
> > should be protected by the lock. Thank you,
> But the traversal in journal_write_revoke_records() *is* in fact guarded
> by the commit logic in journal_commit_transaction() handling code - it
> doesn't allow anybody to mess with revoke lists when a transaction is
> committing. So there's no need to guard the hash list again in
> journal_write_revoke_records() by the spinlock. And if the logic does not
> work and lets somebody modify revoke lists during commit, we have more
> serious problems than hash list corruption. That's why I'm trying to find
> out where's the real culprit of the Oops. But so far I cannot find out how
> the corruption can happen...
I should note here I'm not trying to be argumentative, I just want to
understand. Ok so journal_commit_transaction() will make sure all the
handle_t's are removed and such before processing the revoke lists, but right
before we process the revoke lists we set the journals running transaction to
NULL, which means we can continue on our merry way. AFAICS the revoke lists are
per journal, not per transaction, so once we give up the j_state_lock after
having made sure the handle_t's had done their thing, we set the
running_transaction to NULL letting people continue to do their thing, and since
the revoke table is on a per journal basis, its completely valid for a new
transaction to be started, a handle to be added to it, journal_cancel_revoke()
to be run against that handle while still in journal_commit_transaction(). It
wouldn't necessarily be a handle_t from the transaction we are in the middle of
committing, it would be from a new transaction, and since the revoke list is per
journal, both the transaction thats currently being committed and the new
transaction would have access to the same revoke list, hence the race. Is this
correct? If not let me know because I want to understand this code better.
Thank you,
Josef
next prev parent reply other threads:[~2007-08-21 15:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 15:22 Josef Bacik
2007-08-15 11:37 ` Jan Kara
2007-08-15 12:17 ` Josef Bacik
2007-08-16 16:08 ` Jan Kara
2007-08-16 16:37 ` Josef Bacik
2007-08-20 15:20 ` Jan Kara
2007-08-21 15:43 ` Josef Bacik [this message]
2007-08-21 16:48 ` Jan Kara
2007-08-21 17:45 ` Josef Bacik
2007-08-23 18:41 ` Josef Bacik
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=20070821154311.GE27557@dhcp-243-37.rdu.redhat.com \
--to=jbacik@redhat.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--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®