summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Yihang <xuyihang@huawei.com>2021-04-08 10:00:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-11 15:47:38 +0300
commit72447c925ea90800da153413098c796e4ba6c150 (patch)
treefc2cf439ee23325a007031c0b0df44e5baf3f34b
parentbf4ba04f0161c8b17cfca9cd32118a6215593b30 (diff)
downloadlinux-72447c925ea90800da153413098c796e4ba6c150.tar.xz
ext4: fix error return code in ext4_fc_perform_commit()
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 <hulkci@huawei.com> Signed-off-by: Xu Yihang <xuyihang@huawei.com> Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Link: https://lore.kernel.org/r/20210408070033.123047-1-xuyihang@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ext4/fast_commit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index 4008a674250c..4a0411b229a5 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -1032,8 +1032,10 @@ static int ext4_fc_perform_commit(journal_t *journal)
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);