reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Chris Mason <clmason@fusionio.com>
Cc: reiserfs-devel <reiserfs-devel@vger.kernel.org>
Subject: Re: [PATCH] reiserfs: fix journal list handling
Date: Tue, 14 May 2013 09:37:08 -0400	[thread overview]
Message-ID: <51923E04.2010106@suse.com> (raw)
In-Reply-To: <20130506185748.5844.59533@localhost.localdomain>

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

On 5/6/13 2:57 PM, Chris Mason wrote:
> Quoting Jeff Mahoney (2013-05-06 14:50:33)
>> reiserfs has open coded linked lists to handle its cnode infrastructure.
>>
>> While converting them to list_heads, I found that while the patch looked
>> perfectly straightforward based on what the code should have been doing,
>> it caused crashes nearly immediately. The issue can be reproduced
>> without the conversion by clearing the hprev/hnext pointers in
>> remove_journal_hash() when the cnode is removed from the hash list.
>>
>> It turns out that the code has been working by happy accident for over
>> a decade
> 
> Chris from 1999 is really sorry about that one.  The new code looks much
> less error prone.

It turns out my test was buggy itself. I'd set cn->h{prev,next} to NULL
too early, truncating the list prematurely. Once I fixed that, I wasn't
able to reproduce it anymore. The lists work but the object lifetimes
aren't clear and the jl->cn->hash_list traversals still use stale list
pointers. We can't hit the can_dirty() BUG() from flush_journal_list
because cn->bh has been cleared. Since ->sb, ->blocknr, and ->jlist are
also cleared, the list traversals don't match anything anyway. It's
unclear what is actually getting traversed (I bet it ultimately can end
up traversing the free list), but hits the NULL termination eventually.
Things would definitely be quite a bit more wonky if the cnodes weren't
allocated up front and stashed back on the free list instead of being
freed normally.

I have an updated version that saw some review from Jan Kara that I'll
post shortly.

-Jeff

-- 
Jeff Mahoney
SUSE Labs


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

      reply	other threads:[~2013-05-14 13:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 18:50 [PATCH] reiserfs: fix journal list handling Jeff Mahoney
2013-05-06 18:57 ` [BULK] " Chris Mason
2013-05-14 13:37   ` Jeff Mahoney [this message]

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=51923E04.2010106@suse.com \
    --to=jeffm@suse.com \
    --cc=clmason@fusionio.com \
    --cc=reiserfs-devel@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;
as well as URLs for NNTP newsgroup(s).