Showing error 1713

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/jbd/checkpoint.c
Line in file: 247
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 19:10:05 UTC


Source:

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