Showing error 904

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: fs/jfs/jfs_txnmgr.c
Line in file: 406
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Clang Static Analyzer (3.0)
Smatch (1.59)
Entered: 2012-02-27 21:22:42 UTC


Source:

 376        if (!(flag & COMMIT_FORCE)) {
 377                /*
 378                 * synchronize with logsync barrier
 379                 */
 380                if (test_bit(log_SYNCBARRIER, &log->flag) ||
 381                    test_bit(log_QUIESCE, &log->flag)) {
 382                        INCREMENT(TxStat.txBegin_barrier);
 383                        TXN_SLEEP(&log->syncwait);
 384                        goto retry;
 385                }
 386        }
 387        if (flag == 0) {
 388                /*
 389                 * Don't begin transaction if we're getting starved for tlocks
 390                 * unless COMMIT_FORCE or COMMIT_INODE (which may ultimately
 391                 * free tlocks)
 392                 */
 393                if (TxAnchor.tlocksInUse > TxLockVHWM) {
 394                        INCREMENT(TxStat.txBegin_lockslow);
 395                        TXN_SLEEP(&TxAnchor.lowlockwait);
 396                        goto retry;
 397                }
 398        }
 399
 400        /*
 401         * allocate transaction id/block
 402         */
 403        if ((t = TxAnchor.freetid) == 0) {
 404                jfs_info("txBegin: waiting for free tid");
 405                INCREMENT(TxStat.txBegin_freetid);
 406                TXN_SLEEP(&TxAnchor.freewait);
 407                goto retry;
 408        }
 409
 410        tblk = tid_to_tblock(t);
 411
 412        if ((tblk->next == 0) && !(flag & COMMIT_FORCE)) {
 413                /* Don't let a non-forced transaction take the last tblk */
 414                jfs_info("txBegin: waiting for free tid");
 415                INCREMENT(TxStat.txBegin_freetid);
 416                TXN_SLEEP(&TxAnchor.freewait);
Show full sources