Commit a2bc3d8c authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: Avoid deadlock when all tblocks are allocated

We need to save one tblock for forced transactions, and only transactions
changing the inode allocation tables should be forced.
parent b486a581
...@@ -380,8 +380,8 @@ tid_t txBegin(struct super_block *sb, int flag) ...@@ -380,8 +380,8 @@ tid_t txBegin(struct super_block *sb, int flag)
tblk = tid_to_tblock(t); tblk = tid_to_tblock(t);
if ((tblk->next == 0) && (current != jfsCommitTask)) { if ((tblk->next == 0) && !(flag & COMMIT_FORCE)) {
/* Save one tblk for jfsCommit thread */ /* Don't let a non-forced transaction take the last tblk */
jfs_info("txBegin: waiting for free tid"); jfs_info("txBegin: waiting for free tid");
INCREMENT(TxStat.txBegin_freetid); INCREMENT(TxStat.txBegin_freetid);
TXN_SLEEP(&TxAnchor.freewait); TXN_SLEEP(&TxAnchor.freewait);
...@@ -2994,8 +2994,7 @@ int jfs_sync(void *arg) ...@@ -2994,8 +2994,7 @@ int jfs_sync(void *arg)
* when it is committed * when it is committed
*/ */
TXN_UNLOCK(); TXN_UNLOCK();
tid = txBegin(ip->i_sb, tid = txBegin(ip->i_sb, COMMIT_INODE);
COMMIT_INODE | COMMIT_FORCE);
rc = txCommit(tid, 1, &ip, 0); rc = txCommit(tid, 1, &ip, 0);
txEnd(tid); txEnd(tid);
up(&jfs_ip->commit_sem); up(&jfs_ip->commit_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment