Showing error 1104

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


Source:

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