[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <bda6d13a0607171924v5cd15811v7c9749ad481b232d@mail.gmail.com>
Date: Mon, 17 Jul 2006 19:24:53 -0700
From: "Joshua Hudson" <joshudson@...il.com>
To: linux-kernel@...r.kernel.org
Subject: How to explain to lock validator: locking inodes in inode order
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.
Note struct kb0_idata has an element of struct inode called vi.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists