diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 0ab83bb7bbdf..6e5b4431f287 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c @@ -1926,7 +1926,13 @@ static int dtSplitRoot(tid_t tid, */ tlck = txLock(tid, ip, rmp, tlckDTREE | tlckNEW); dtlck = (struct dt_lock *) & tlck->lock; - + printk(KERN_ERR "JFS_DEBUG: dtSplitRoot before assertion\n"); + printk(KERN_ERR " tid=%d, ip=%p, rmp=%p\n", tid, ip, rmp); + printk(KERN_ERR " tlck=%p, tlck->tid=%d, tlck->type=0x%x\n", tlck, tlck->tid, tlck->type); + printk(KERN_ERR " dtlck=%p, dtlck->index=%d\n", dtlck, dtlck->index); + if (dtlck->index != 0) { + printk(KERN_ERR " ERROR: index is %d, expected 0!\n", dtlck->index); + } rp->header.flag = (sp->header.flag & BT_LEAF) ? BT_LEAF : BT_INTERNAL; rp->header.self = *pxd; diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index c16578af3a77..bb2fb9bc3440 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c @@ -811,6 +811,23 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, * update tlock vector */ grantLock: + if ((type & tlckDTREE) && (type & tlckNEW)) { + struct dt_lock *dtlck = (struct dt_lock *)&tlck->lock; + struct linelock *linelock = (struct linelock *)&tlck->lock; + printk(KERN_ERR "JFS_DEBUG: txLock grantLock (DTREE)\n"); + printk(KERN_ERR " tid=%d, ip=%p, mp=%p\n", tid, ip, mp); + printk(KERN_ERR " type=0x%x (DTREE=%d, NEW=%d)\n", type, !!(type & tlckDTREE), !!(type & tlckNEW)); + printk(KERN_ERR " tlck=%p, tlck->tid=%d\n", tlck, tlck->tid); + printk(KERN_ERR " BEFORE: linelock->index=%d\n", linelock->index); + printk(KERN_ERR " BEFORE: linelock->next=%d, flag=%d\n",linelock->next, linelock->flag); + if (type & tlckNEW) { + printk(KERN_ERR " ACTION: Resetting index to 0 (tlckNEW)\n"); + dtlck->index = 0; + } else { + printk(KERN_ERR " ACTION: NOT resetting (no tlckNEW)\n"); + } + printk(KERN_ERR " AFTER: linelock->index=%d\n", linelock->index); + } tlck->type |= type; return tlck;