Comments

Commit 09e05d48 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>
---
fs/jbd/transaction.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
I want to push this fix to Linus soon. JBD2 needs the fix as well but there
it affects only data=journal mode and the fix is more complex due to different
lock ordering.