All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	hch@infradead.org, torvalds@linux-foundation.org,
	Trond.Myklebust@netapp.com
Subject: Re: [PATCH 1/2] vfs: dcache: fix deadlock in tree traversal
Date: Mon, 17 Sep 2012 21:39:47 +0100	[thread overview]
Message-ID: <20120917203946.GV13973@ZenIV.linux.org.uk> (raw)
In-Reply-To: <871ui01jr1.fsf@tucsk.pomaz.szeredi.hu>

On Mon, Sep 17, 2012 at 10:23:30PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@suse.cz>
> 
> IBM reported a deadlock in select_parent().  This was found to be caused by
> taking rename_lock when already locked when restarting the tree traversal.
> 
> There are two cases when the traversal needs to be restarted:
> 
>  1) concurrent d_move(); this can only happen when not already locked,
>  since taking rename_lock protects against concurrent d_move().
> 
>  2) racing with final d_put() on child just at the moment of ascending
>  to parent; rename_lock doesn't protect against this rare race, so it
>  can happen when already locked.
> 
> Because of case 2. we need to be able to handle restarting the traversal
> when rename_lock is already held.  This patch fixes all three callers of
> try_to_ascend().
> 
> IBM reported that the deadlock is gone with this patch.  However, there's still
> a soft lockup which is addressed by the next patch.

Egads...  The problem is real and analysis, AFAICS, is correct, but result
is extremely ugly ;-/  Let me try to come up with something saner; I'll
push that one to Linus if nothing better comes to mind, but I'd really
prefer to avoid adding to ugliness in fs/dcache.c - we already have too
much of that...

  parent reply	other threads:[~2012-09-17 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 20:23 [PATCH 1/2] vfs: dcache: fix deadlock in tree traversal Miklos Szeredi
2012-09-17 20:31 ` [PATCH 2/2] vfs: dcache: use DCACHE_DENTRY_KILLED instead of DCACHE_DISCONNECTED in d_kill() Miklos Szeredi
2012-09-17 20:39 ` Al Viro [this message]
2012-09-17 22:09   ` [PATCH 1/2] vfs: dcache: fix deadlock in tree traversal Linus Torvalds
2012-09-18 14:53     ` Miklos Szeredi
2012-09-18 15:56       ` Linus Torvalds
2012-09-18 16:27         ` Miklos Szeredi
2012-09-18 18:22           ` Linus Torvalds
2012-09-18 20:35 ` [PATCH] trivial select_parent documentation fix J. Bruce Fields

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=20120917203946.GV13973@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=Trond.Myklebust@netapp.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.