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: | 2735 |
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 |
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); 2739 2740 /* we've got enough space */ 2741 xlog_grant_add_space_write(log, need_bytes); 2742#ifdef DEBUG 2743 tail_lsn = log->l_tail_lsn; 2744 if (CYCLE_LSN(tail_lsn) != log->l_grant_write_cycle) { 2745 ASSERT(log->l_grant_write_cycle-1 == CYCLE_LSN(tail_lsn));