aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2005-08-10 12:14:39 -0400
committerDave Kleikamp <shaggy@austin.ibm.com>2005-08-10 12:14:39 -0400
commit8a9cd6d676728792aaee31f30015d284acd154a3 (patch)
tree7e40b3b1802b1a86603f7ac6bf74906775a2956e /fs
parenta5c96cab8f3c4ca9b2177dceb5de5a0edb31418e (diff)
JFS: Fix race in txLock
TxAnchor.anon_list is protected by jfsTxnLock (TXN_LOCK), but there was a place in txLock() that was removing an entry from the list without holding the spinlock. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/jfs/jfs_txnmgr.c2
-rw-r--r--fs/jfs/super.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 3555acff12d0..c7a92f9deb2b 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -657,7 +657,9 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
657 /* only anonymous txn. 657 /* only anonymous txn.
658 * Remove from anon_list 658 * Remove from anon_list
659 */ 659 */
660 TXN_LOCK();
660 list_del_init(&jfs_ip->anon_inode_list); 661 list_del_init(&jfs_ip->anon_inode_list);
662 TXN_UNLOCK();
661 } 663 }
662 jfs_ip->atlhead = tlck->next; 664 jfs_ip->atlhead = tlck->next;
663 } else { 665 } else {
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index c2abdaee0c0b..9ff89720f93b 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -114,6 +114,8 @@ static void jfs_destroy_inode(struct inode *inode)
114{ 114{
115 struct jfs_inode_info *ji = JFS_IP(inode); 115 struct jfs_inode_info *ji = JFS_IP(inode);
116 116
117 BUG_ON(!list_empty(&ji->anon_inode_list));
118
117 spin_lock_irq(&ji->ag_lock); 119 spin_lock_irq(&ji->ag_lock);
118 if (ji->active_ag != -1) { 120 if (ji->active_ag != -1) {
119 struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; 121 struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap;