mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How to explain to lock validator: locking inodes in inode order
@ 2006-07-18  2:24 Joshua Hudson
  2006-07-18  3:31 ` Arjan van de Ven
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Hudson @ 2006-07-18  2:24 UTC (permalink / raw)
  To: linux-kernel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-18  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-18  2:24 How to explain to lock validator: locking inodes in inode order Joshua Hudson
2006-07-18  3:31 ` Arjan van de Ven
2006-07-18  4:19   ` Joshua Hudson
2006-07-18  9:09     ` Arjan van de Ven

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®