Showing error 1714

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: fs/jbd2/checkpoint.c
Line in file: 249
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 19:10:05 UTC


Source:

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);
233                        spin_lock(&journal->j_list_lock);
234                        goto restart;
235                }
236                if (unlikely(buffer_write_io_error(bh)))
237                        ret = -EIO;
238
239                /*
240                 * Now in whatever state the buffer currently is, we know that
241                 * it has been written out and so we can drop it from the list
242                 */
243                released = __jbd2_journal_remove_checkpoint(jh);
244                jbd_unlock_bh_state(bh);
245                jbd2_journal_remove_journal_head(bh);
246                __brelse(bh);
247        }
248
249        return ret;
250}
251
252#define NR_BATCH        64
253
254static void
255__flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
256{
257        int i;
258
259        ll_rw_block(SWRITE, *batch_count, bhs);
Show full sources