Re: hugetlb locking bug.

From: Peter Zijlstra
Date: Fri Apr 15 2011 - 17:04:44 EST

On Fri, 2011-04-15 at 13:49 -0700, Linus Torvalds wrote:
> Hmm. Adding the hugetlbfs/lockdep people to the cc.
> This _looks_ like the same kind of false positive we've had with some
> other cases: we're taking the i_mutex lock only dor directory inodes
> (for the readdir) and we take the i_mmap lock only for non-directory
> inodes, so you can't actually get any real circular locking issues.
> So yes, we do mix the order of i_mmap_sem and i_mutex, but it's
> conceptually two "different" kinds of i_mutex that just happen to
> share a name.
> And I really thought we annotated it as such with different
> "lockdep_set_class()" cases (ie the whole
> lockdep_set_class(&inode->i_mutex,&type->i_mutex_dir_key);
> for the S_ISDIR case in unlock_new_inode().
> Can somebody more alert than me see why this lockdep issue still
> triggers with hugetlbfs?

afaict hugetlbfs doesn't actually end up calling unlock_new_inode()
which does the whole IS_DIR() lockdep annotation, but then I might have
gotten lost in the whole inode allocation dance.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at