|
@@ -999,7 +999,6 @@ xfs_fs_inode_init_once(
|
|
|
|
|
|
mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
|
|
|
"xfsino", ip->i_ino);
|
|
|
- mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -1101,6 +1100,20 @@ xfs_fs_clear_inode(
|
|
|
XFS_STATS_INC(vn_remove);
|
|
|
XFS_STATS_DEC(vn_active);
|
|
|
|
|
|
+ /*
|
|
|
+ * The iolock is used by the file system to coordinate reads,
|
|
|
+ * writes, and block truncates. Up to this point the lock
|
|
|
+ * protected concurrent accesses by users of the inode. But
|
|
|
+ * from here forward we're doing some final processing of the
|
|
|
+ * inode because we're done with it, and although we reuse the
|
|
|
+ * iolock for protection it is really a distinct lock class
|
|
|
+ * (in the lockdep sense) from before. To keep lockdep happy
|
|
|
+ * (and basically indicate what we are doing), we explicitly
|
|
|
+ * re-init the iolock here.
|
|
|
+ */
|
|
|
+ ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock));
|
|
|
+ mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino);
|
|
|
+
|
|
|
xfs_inactive(ip);
|
|
|
}
|
|
|
|