]> Git Repo - linux.git/commitdiff
jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()
authorzhangyi (F) <[email protected]>
Sat, 20 Jun 2020 06:19:48 +0000 (14:19 +0800)
committerTheodore Ts'o <[email protected]>
Thu, 6 Aug 2020 04:15:58 +0000 (00:15 -0400)
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: 742b06b5628f ("jbd2: check superblock mapped prior to committing")
Signed-off-by: zhangyi (F) <[email protected]>
Reviewed-by: Ritesh Harjani <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
fs/jbd2/journal.c

index e4944436e733d01611504502455d24147fa1f2ce..5493a0da23ddd3eb37e89e3322b110beedb709ee 100644 (file)
@@ -1367,8 +1367,10 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags)
        int ret;
 
        /* Buffer got discarded which means block device got invalidated */
-       if (!buffer_mapped(bh))
+       if (!buffer_mapped(bh)) {
+               unlock_buffer(bh);
                return -EIO;
+       }
 
        trace_jbd2_write_superblock(journal, write_flags);
        if (!(journal->j_flags & JBD2_BARRIER))
This page took 0.055157 seconds and 4 git commands to generate.