Commit 13181061 authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: prevent concurrent calls to txCommit on the imap inode

Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
parent e83a5d51
...@@ -1280,6 +1280,7 @@ int diFree(struct inode *ip) ...@@ -1280,6 +1280,7 @@ int diFree(struct inode *ip)
* to be freed by the transaction; * to be freed by the transaction;
*/ */
tid = txBegin(ipimap->i_sb, COMMIT_FORCE); tid = txBegin(ipimap->i_sb, COMMIT_FORCE);
down(&JFS_IP(ipimap)->commit_sem);
/* acquire tlock of the iag page of the freed ixad /* acquire tlock of the iag page of the freed ixad
* to force the page NOHOMEOK (even though no data is * to force the page NOHOMEOK (even though no data is
...@@ -1312,6 +1313,7 @@ int diFree(struct inode *ip) ...@@ -1312,6 +1313,7 @@ int diFree(struct inode *ip)
rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE); rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE);
txEnd(tid); txEnd(tid);
up(&JFS_IP(ipimap)->commit_sem);
/* unlock the AG inode map information */ /* unlock the AG inode map information */
AG_UNLOCK(imap, agno); AG_UNLOCK(imap, agno);
...@@ -2622,10 +2624,13 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) ...@@ -2622,10 +2624,13 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
*/ */
#endif /* _STILL_TO_PORT */ #endif /* _STILL_TO_PORT */
tid = txBegin(sb, COMMIT_FORCE); tid = txBegin(sb, COMMIT_FORCE);
down(&JFS_IP(ipimap)->commit_sem);
/* update the inode map addressing structure to point to it */ /* update the inode map addressing structure to point to it */
if ((rc = if ((rc =
xtInsert(tid, ipimap, 0, blkno, xlen, &xaddr, 0))) { xtInsert(tid, ipimap, 0, blkno, xlen, &xaddr, 0))) {
txEnd(tid);
up(&JFS_IP(ipimap)->commit_sem);
/* Free the blocks allocated for the iag since it was /* Free the blocks allocated for the iag since it was
* not successfully added to the inode map * not successfully added to the inode map
*/ */
...@@ -2650,6 +2655,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp) ...@@ -2650,6 +2655,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE); rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE);
txEnd(tid); txEnd(tid);
up(&JFS_IP(ipimap)->commit_sem);
duplicateIXtree(sb, blkno, xlen, &xaddr); duplicateIXtree(sb, blkno, xlen, &xaddr);
......
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