Commit ef3f5830 authored by zhangyi (F)'s avatar zhangyi (F) Committed by Theodore Ts'o

jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()

jbd2_write_superblock() is under the buffer lock of journal superblock
before ending that superblock write, so add a missing unlock_buffer() in
in the error path before submitting buffer.

Fixes: 742b06b5 ("jbd2: check superblock mapped prior to committing")
Signed-off-by: default avatarzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: default avatarRitesh Harjani <riteshh@linux.ibm.com>
Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20200620061948.2049579-1-yi.zhang@huawei.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 5872331b
...@@ -1367,8 +1367,10 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags) ...@@ -1367,8 +1367,10 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags)
int ret; int ret;
/* Buffer got discarded which means block device got invalidated */ /* Buffer got discarded which means block device got invalidated */
if (!buffer_mapped(bh)) if (!buffer_mapped(bh)) {
unlock_buffer(bh);
return -EIO; return -EIO;
}
trace_jbd2_write_superblock(journal, write_flags); trace_jbd2_write_superblock(journal, write_flags);
if (!(journal->j_flags & JBD2_BARRIER)) if (!(journal->j_flags & JBD2_BARRIER))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment