mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Joshua Hudson" <joshudson@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Possible deadlock in vfs layer, namei.c
Date: Wed, 1 Mar 2006 18:46:42 -0800	[thread overview]
Message-ID: <bda6d13a0603011846s6bfed498ha9fb78c4ba74963c@mail.gmail.com> (raw)

I've been hunting down various deadlocks caused by hard links to directories.
I found one that can happen *without* such things.

Consider this:

17 3 drwxr-xr-x root sys 4096 dir
18 2 drwxr-xr-x root sys 4096 dir/subdir
19 1 -rwxr-xr-x root sys 1733 dir/subdir/file

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

rmdir takes (multiple functions):
1. dir  (sys_rename)
2. dir/subdir (vfs_rename)

Suppose this happends:
[proc 1] s_vfs_rename_sem
[proc 1] dir/subdir
*task switch*
[proc 2] dir
[proc 2] dir/subdir ->deadlock

preempt_disable() won't help here. Could also be triggered on a SMP
machine w/o preempt.
Am studying situation, doesn't look promising.

             reply	other threads:[~2006-03-02  2:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02  2:46 Joshua Hudson [this message]
2006-03-02  2:54 ` Al Viro
     [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=bda6d13a0603011846s6bfed498ha9fb78c4ba74963c@mail.gmail.com \
    --to=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 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®