Showing error 1113

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: fs/xfs/xfs_log.c
Line in file: 2728
Project: Linux Kernel
Project version: 2.6.28
Tools: Clang Static Analyzer (3.0)
Smatch (1.59)
Entered: 2012-04-17 12:29:30 UTC


Source:

2698                        /* If we're shutting down, this tic is already
2699                         * off the queue */
2700                        if (XLOG_FORCED_SHUTDOWN(log)) {
2701                                spin_lock(&log->l_grant_lock);
2702                                goto error_return;
2703                        }
2704
2705                        xlog_trace_loggrant(log, tic,
2706                                    "xlog_regrant_write_log_space: wake 1");
2707                        xlog_grant_push_ail(log->l_mp, tic->t_unit_res);
2708                        spin_lock(&log->l_grant_lock);
2709                }
2710        }
2711
2712        need_bytes = tic->t_unit_res;
2713
2714redo:
2715        if (XLOG_FORCED_SHUTDOWN(log))
2716                goto error_return;
2717
2718        free_bytes = xlog_space_left(log, log->l_grant_write_cycle,
2719                                     log->l_grant_write_bytes);
2720        if (free_bytes < need_bytes) {
2721                if ((tic->t_flags & XLOG_TIC_IN_Q) == 0)
2722                        xlog_ins_ticketq(&log->l_write_headq, tic);
2723                XFS_STATS_INC(xs_sleep_logspace);
2724                sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s);
2725
2726                /* If we're shutting down, this tic is already off the queue */
2727                if (XLOG_FORCED_SHUTDOWN(log)) {
2728                        spin_lock(&log->l_grant_lock);
2729                        goto error_return;
2730                }
2731
2732                xlog_trace_loggrant(log, tic,
2733                                    "xlog_regrant_write_log_space: wake 2");
2734                xlog_grant_push_ail(log->l_mp, need_bytes);
2735                spin_lock(&log->l_grant_lock);
2736                goto redo;
2737        } else if (tic->t_flags & XLOG_TIC_IN_Q)
2738                xlog_del_ticketq(&log->l_write_headq, tic);
Show full sources