|
@@ -1258,6 +1258,14 @@ xfs_setup_inode(
|
|
|
xfs_diflags_to_iflags(inode, ip);
|
|
|
|
|
|
if (S_ISDIR(inode->i_mode)) {
|
|
|
+ /*
|
|
|
+ * We set the i_rwsem class here to avoid potential races with
|
|
|
+ * lockdep_annotate_inode_mutex_key() reinitialising the lock
|
|
|
+ * after a filehandle lookup has already found the inode in
|
|
|
+ * cache before it has been unlocked via unlock_new_inode().
|
|
|
+ */
|
|
|
+ lockdep_set_class(&inode->i_rwsem,
|
|
|
+ &inode->i_sb->s_type->i_mutex_dir_key);
|
|
|
lockdep_set_class(&ip->i_lock.mr_lock, &xfs_dir_ilock_class);
|
|
|
ip->d_ops = ip->i_mount->m_dir_inode_ops;
|
|
|
} else {
|