From: Al Viro <viro@ftp.linux.org.uk>
To: Joshua Hudson <joshudson@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible deadlock in vfs layer, namei.c
Date: Thu, 2 Mar 2006 02:54:06 +0000 [thread overview]
Message-ID: <20060302025406.GV27946@ftp.linux.org.uk> (raw)
In-Reply-To: <bda6d13a0603011846s6bfed498ha9fb78c4ba74963c@mail.gmail.com>
On Wed, Mar 01, 2006 at 06:46:42PM -0800, Joshua Hudson wrote:
> I've been hunting down various deadlocks caused by hard links to directories.
> I found one that can happen *without* such things.
> process 1 does: rename("dir/subdir/file", "dir/file")
> process 2 does: rmdir("dir/subdir")
>
> from namei.c (function: lock_rename), rename takes:
> 1. s_vfs_rename_sem,
> 2. dir/subdir: p1->d_inode->i_sem
> 3. dir: p2->d_inode->i_sem
No, it doesn't. Wrong order - it will take dir before dir/subdir.
RTFM - Documentation/filesystems/directory-locking is there for
purpose.
next prev parent reply other threads:[~2006-03-02 2:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 2:46 Possible deadlock in vfs layer, namei.c Joshua Hudson
2006-03-02 2:54 ` Al Viro [this message]
[not found] ` <bda6d13a0603011901x4b54c5a5jfed30f5fc629a3e@mail.gmail.com>
2006-03-02 3:22 ` Fwd: " Joshua Hudson
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=20060302025406.GV27946@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=joshudson@gmail.com \
--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 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.