Showing error 1038

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: 175
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

145                        int chkpt = journal->j_checkpoint_transactions != NULL;
146                        tid_t tid = 0;
147
148                        if (journal->j_committing_transaction)
149                                tid = journal->j_committing_transaction->t_tid;
150                        spin_unlock(&journal->j_list_lock);
151                        spin_unlock(&journal->j_state_lock);
152                        if (chkpt) {
153                                jbd2_log_do_checkpoint(journal);
154                        } else if (jbd2_cleanup_journal_tail(journal) == 0) {
155                                /* We were able to recover space; yay! */
156                                ;
157                        } else if (tid) {
158                                jbd2_log_wait_commit(journal, tid);
159                        } else {
160                                printk(KERN_ERR "%s: needed %d blocks and "
161                                       "only had %d space available\n",
162                                       __func__, nblocks, space_left);
163                                printk(KERN_ERR "%s: no way to get more "
164                                       "journal space in %s\n", __func__,
165                                       journal->j_devname);
166                                WARN_ON(1);
167                                jbd2_journal_abort(journal, 0);
168                        }
169                        spin_lock(&journal->j_state_lock);
170                } else {
171                        spin_unlock(&journal->j_list_lock);
172                }
173                mutex_unlock(&journal->j_checkpoint_mutex);
174        }
175}
176
177/*
178 * We were unable to perform jbd_trylock_bh_state() inside j_list_lock.
179 * The caller must restart a list walk.  Wait for someone else to run
180 * jbd_unlock_bh_state().
181 */
182static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh)
183        __releases(journal->j_list_lock)
184{
185        get_bh(bh);
Show full sources