]> www.infradead.org Git - linux-platform-drivers-x86.git/commitdiff
ext4: fix error return code in ext4_fc_perform_commit()
authorXu Yihang <xuyihang@huawei.com>
Thu, 8 Apr 2021 07:00:33 +0000 (15:00 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 10 Apr 2021 01:28:30 +0000 (21:28 -0400)
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>
fs/ext4/fast_commit.c

index 7541d0b5d7069a169600f5ba26e41de125bc6528..312273ed8a9fea4a02a916092b01533ec5f8674c 100644 (file)
@@ -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);