提交 8a9cd6d6 编写于 作者: D Dave Kleikamp

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: NDave Kleikamp <shaggy@austin.ibm.com>
上级 a5c96cab
...@@ -657,7 +657,9 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, ...@@ -657,7 +657,9 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp,
/* only anonymous txn. /* only anonymous txn.
* Remove from anon_list * Remove from anon_list
*/ */
TXN_LOCK();
list_del_init(&jfs_ip->anon_inode_list); list_del_init(&jfs_ip->anon_inode_list);
TXN_UNLOCK();
} }
jfs_ip->atlhead = tlck->next; jfs_ip->atlhead = tlck->next;
} else { } else {
......
...@@ -114,6 +114,8 @@ static void jfs_destroy_inode(struct inode *inode) ...@@ -114,6 +114,8 @@ static void jfs_destroy_inode(struct inode *inode)
{ {
struct jfs_inode_info *ji = JFS_IP(inode); struct jfs_inode_info *ji = JFS_IP(inode);
BUG_ON(!list_empty(&ji->anon_inode_list));
spin_lock_irq(&ji->ag_lock); spin_lock_irq(&ji->ag_lock);
if (ji->active_ag != -1) { if (ji->active_ag != -1) {
struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册