diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 15 | ||||
-rw-r--r-- | fs/xfs/xfs_iget.c | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index a82a93db67c..25b6903a3bc 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -999,7 +999,6 @@ xfs_fs_inode_init_once( | |||
999 | 999 | ||
1000 | mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER, | 1000 | mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER, |
1001 | "xfsino", ip->i_ino); | 1001 | "xfsino", ip->i_ino); |
1002 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); | ||
1003 | } | 1002 | } |
1004 | 1003 | ||
1005 | /* | 1004 | /* |
@@ -1101,6 +1100,20 @@ xfs_fs_clear_inode( | |||
1101 | XFS_STATS_INC(vn_remove); | 1100 | XFS_STATS_INC(vn_remove); |
1102 | XFS_STATS_DEC(vn_active); | 1101 | XFS_STATS_DEC(vn_active); |
1103 | 1102 | ||
1103 | /* | ||
1104 | * The iolock is used by the file system to coordinate reads, | ||
1105 | * writes, and block truncates. Up to this point the lock | ||
1106 | * protected concurrent accesses by users of the inode. But | ||
1107 | * from here forward we're doing some final processing of the | ||
1108 | * inode because we're done with it, and although we reuse the | ||
1109 | * iolock for protection it is really a distinct lock class | ||
1110 | * (in the lockdep sense) from before. To keep lockdep happy | ||
1111 | * (and basically indicate what we are doing), we explicitly | ||
1112 | * re-init the iolock here. | ||
1113 | */ | ||
1114 | ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); | ||
1115 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); | ||
1116 | |||
1104 | xfs_inactive(ip); | 1117 | xfs_inactive(ip); |
1105 | } | 1118 | } |
1106 | 1119 | ||
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 80e526489be..cc72c561ff5 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c | |||
@@ -73,6 +73,9 @@ xfs_inode_alloc( | |||
73 | ASSERT(atomic_read(&ip->i_pincount) == 0); | 73 | ASSERT(atomic_read(&ip->i_pincount) == 0); |
74 | ASSERT(!spin_is_locked(&ip->i_flags_lock)); | 74 | ASSERT(!spin_is_locked(&ip->i_flags_lock)); |
75 | ASSERT(completion_done(&ip->i_flush)); | 75 | ASSERT(completion_done(&ip->i_flush)); |
76 | ASSERT(!rwsem_is_locked(&ip->i_iolock.mr_lock)); | ||
77 | |||
78 | mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); | ||
76 | 79 | ||
77 | /* initialise the xfs inode */ | 80 | /* initialise the xfs inode */ |
78 | ip->i_ino = ino; | 81 | ip->i_ino = ino; |