Showing error 1105

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


Source:

192/*
193 * Clean up transaction's list of buffers submitted for io.
194 * We wait for any pending IO to complete and remove any clean
195 * buffers. Note that we take the buffers in the opposite ordering
196 * from the one in which they were submitted for IO.
197 *
198 * Return 0 on success, and return <0 if some buffers have failed
199 * to be written out.
200 *
201 * Called with j_list_lock held.
202 */
203static int __wait_cp_io(journal_t *journal, transaction_t *transaction)
204{
205        struct journal_head *jh;
206        struct buffer_head *bh;
207        tid_t this_tid;
208        int released = 0;
209        int ret = 0;
210
211        this_tid = transaction->t_tid;
212restart:
213        /* Did somebody clean up the transaction in the meanwhile? */
214        if (journal->j_checkpoint_transactions != transaction ||
215                        transaction->t_tid != this_tid)
216                return ret;
217        while (!released && transaction->t_checkpoint_io_list) {
218                jh = transaction->t_checkpoint_io_list;
219                bh = jh2bh(jh);
220                if (!jbd_trylock_bh_state(bh)) {
221                        jbd_sync_bh(journal, bh);
222                        spin_lock(&journal->j_list_lock);
223                        goto restart;
224                }
225                if (buffer_locked(bh)) {
226                        atomic_inc(&bh->b_count);
227                        spin_unlock(&journal->j_list_lock);
228                        jbd_unlock_bh_state(bh);
229                        wait_on_buffer(bh);
230                        /* the journal_head may have gone by now */
231                        BUFFER_TRACE(bh, "brelse");
232                        __brelse(bh);
Show full sources