linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: linux-fsdevel@vger.kernel.org
Subject: Fw: Spam: [Bugme-new] [Bug 2829] New: posix_locks_deadlock() loops infinitely
Date: Thu, 3 Jun 2004 22:50:12 -0700	[thread overview]
Message-ID: <20040603225012.301f42a6.akpm@osdl.org> (raw)



Begin forwarded message:

Date: Thu, 3 Jun 2004 22:45:56 -0700
From: bugme-daemon@osdl.org
To: bugme-new@lists.osdl.org
Subject: Spam: [Bugme-new] [Bug 2829] New: posix_locks_deadlock() loops infinitely


http://bugme.osdl.org/show_bug.cgi?id=2829

           Summary: posix_locks_deadlock() loops infinitely
    Kernel Version: 2.6.6
            Status: NEW
          Severity: normal
             Owner: fs_vfs@kernel-bugs.osdl.org
         Submitter: i-sakamoto@pb.jp.nec.com


Distribution: debian
Hardware Environment:
Software Environment:
Problem Description: Using POSIX threads makes posix_locks_deadlock() loop
infinitely.

Steps to reproduce:

There are 3 processes; "A", "B" and "C".
Each process opens "file1", "file2" and "file3".

"A" creates 3 POSIX threads; "A1", "A2" and "A3". (These threads' PIDs are the
same.)
"B" creates 2 POSIX threads; "B1" and "B2". (These threads' PIDs are the same.)
"C" creates 1 POSIX thread; "C1".


1. "A1" locks "file1" exclusively.
2. "B1" locks "file2" exclusively.
3. "C1" locks "file3" exclusively.
4. "A2" trys to lock "file2" and sleeps (blocked by "B1").
5. "A3" trys to lock "file3" and sleeps (blocked by "C1").
6. "B2" trys to lock "file1".
   Here, posix_locks_deadlock() must detect deadlock, but
   it does not. Then "B2" sleeps (blocked "A1").

  "A"                                    "B"
   |                                      |
   +--A1(LOCK)---->(file1)<-B2(*deadlock)-+
   |                                      |
   |                                      |
   +--A2(BLOCK)--->(file2)<---B1(LOCK)----+
   |
   |
   +--A3(BLOCK)--->(file3)<---C1(LOCK)----"C"

    block_list -> A3(BLOCK) -> A2(BLOCK)


7. "C1" unlocks "file3". ("A3" wakes up and locks "file3".)
8. "A3" unlocks "file3".
9. Another process locks "file1".
   This makes posix_locks_deadlock() loop infinitely.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

             reply	other threads:[~2004-06-04  5:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-04  5:50 Andrew Morton [this message]
2004-06-04  5:53 ` [Bug 2829] New: posix_locks_deadlock() loops infinitely Andrew Morton
2004-06-04  7:15   ` Ichiko Sakamoto
2004-06-04 11:20 ` Fw: Spam: [Bugme-new] " Matthew Wilcox
2004-06-05  2:18   ` Andrew Morton
2004-06-05  2:45     ` Trond Myklebust
2004-06-05  3:36       ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2004-06-05  3:29 Stephen Rothwell
2004-06-05  3:47 ` Trond Myklebust
2004-06-05  3:32 Stephen Rothwell
2004-06-05  7:25 Stephen Rothwell
2004-06-06  3:04 ` Stephen Rothwell

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=20040603225012.301f42a6.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-fsdevel@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).