mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Joshua Hudson <joshudson@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to explain to lock validator: locking inodes in inode order
Date: Tue, 18 Jul 2006 05:31:53 +0200	[thread overview]
Message-ID: <1153193513.4533.3.camel@testmachine> (raw)
In-Reply-To: <bda6d13a0607171924v5cd15811v7c9749ad481b232d@mail.gmail.com>

On Mon, 2006-07-17 at 19:24 -0700, Joshua Hudson wrote:
> Code does this:
> 
> /* Lock two items. See locking.txt */
> static inline void kb0_lock2m(struct kb0_idata *m1, struct kb0_idata *m2)
> {
>         if (m1->vi.i_ino > m2->vi.i_ino)
>                 mutex_lock(&m2->k_mutex);
>         mutex_lock(&m1->k_mutex);
>         if (m1->vi.i_ino < m2->vi.i_ino)
>                 mutex_lock(&m2->k_mutex);
> }
> 
> Not sure how to explain to the lock validator that this code can never deadlock.

you're sure it can;t? (which fs is this btw?)

all places in the kernel that take this mutex in that order only do it
in i_ino order, including all directory operations like cross directory
rename?

(if so you can explain normal parent/child nesting, but only if so)


  reply	other threads:[~2006-07-18  3:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18  2:24 Joshua Hudson
2006-07-18  3:31 ` Arjan van de Ven [this message]
2006-07-18  4:19   ` Joshua Hudson
2006-07-18  9:09     ` Arjan van de Ven

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=1153193513.4533.3.camel@testmachine \
    --to=arjan@infradead.org \
    --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 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®