VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: zhangyi (F) <yi.zhang@huawei.com> 2020-06-20 14:19:48 +0800 committer: Theodore Ts'o <tytso@mit.edu> 2020-08-06 00:15:58 -0400 commit: ef3f5830b859604eda8723c26d90ab23edc027a4 parent: 5872331b3d91820e14716632ebb56b1399b34fe1
Commit Summary:
jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock()
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index e4944436e733..5493a0da23dd 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -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))