summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorXu Yihang <xuyihang@huawei.com>2021-04-08 09:00:33 +0200
committerTheodore Ts'o <tytso@mit.edu>2021-04-10 03:28:30 +0200
commite1262cd2e68a0870fb9fc95eb202d22e8f0074b7 (patch)
tree7f16a84cd1afd0591b46e2c8632a43f6175d697b /fs
parentext4: annotate data race in jbd2_journal_dirty_metadata() (diff)
downloadlinux-e1262cd2e68a0870fb9fc95eb202d22e8f0074b7.tar.xz
linux-e1262cd2e68a0870fb9fc95eb202d22e8f0074b7.zip
ext4: fix error return code in ext4_fc_perform_commit()
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>
Diffstat (limited to 'fs')
-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 7541d0b5d706..312273ed8a9f 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -1088,8 +1088,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);