Thread (396 messages) 396 messages, 10 authors, 2021-05-11
STALE1902d REVIEWED: 1 (0M)

[PATCH 5.12 343/384] ext4: fix error return code in ext4_fc_perform_commit()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-05-10 12:49:11
Also in: lkml

From: Xu Yihang <redacted>

commit e1262cd2e68a0870fb9fc95eb202d22e8f0074b7 upstream.

In case of if not ext4_fc_add_tlv branch, an error return code is missing.

Cc: stable@kernel.org
Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Xu Yihang <redacted>
Reviewed-by: Harshad Shirwadkar <redacted>
Link: https://lore.kernel.org/r/20210408070033.123047-1-xuyihang@huawei.com (local)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/ext4/fast_commit.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -1088,8 +1088,10 @@ static int ext4_fc_perform_commit(journa
 		head.fc_tid = cpu_to_le32(
 			sbi->s_journal->j_running_transaction->t_tid);
 		if (!ext4_fc_add_tlv(sb, EXT4_FC_TAG_HEAD, sizeof(head),
-			(u8 *)&head, &crc))
+			(u8 *)&head, &crc)) {
+			ret = -ENOSPC;
 			goto out;
+		}
 	}
 
 	spin_lock(&sbi->s_fc_lock);

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help