Showing error 902

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: 383
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:

 353 *
 354 * PARAMETER:        sb        - superblock
 355 *                flag        - force for nested tx;
 356 *
 357 * RETURN:        tid        - transaction id
 358 *
 359 * note: flag force allows to start tx for nested tx
 360 * to prevent deadlock on logsync barrier;
 361 */
 362tid_t txBegin(struct super_block *sb, int flag)
 363{
 364        tid_t t;
 365        struct tblock *tblk;
 366        struct jfs_log *log;
 367
 368        jfs_info("txBegin: flag = 0x%x", flag);
 369        log = JFS_SBI(sb)->log;
 370
 371        TXN_LOCK();
 372
 373        INCREMENT(TxStat.txBegin);
 374
 375      retry:
 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) {
Show full sources