mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
jbd: Fix lock ordering bug in journal_unmap_buffer()
commit25389bb207
upstream. Commit09e05d48
introduced a wait for transaction commit into journal_unmap_buffer() in the case we are truncating a buffer undergoing commit in the page stradding i_size on a filesystem with blocksize < pagesize. Sadly we forgot to drop buffer lock before waiting for transaction commit and thus deadlock is possible when kjournald wants to lock the buffer. Fix the problem by dropping the buffer lock before waiting for transaction commit. Since we are still holding page lock (and that is OK), buffer cannot disappear under us. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c9fa3f41a9
commit
acaf0ed4bd
1 changed files with 2 additions and 0 deletions
|
@ -1963,7 +1963,9 @@ retry:
|
|||
spin_unlock(&journal->j_list_lock);
|
||||
jbd_unlock_bh_state(bh);
|
||||
spin_unlock(&journal->j_state_lock);
|
||||
unlock_buffer(bh);
|
||||
log_wait_commit(journal, tid);
|
||||
lock_buffer(bh);
|
||||
goto retry;
|
||||
}
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue