Re: [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit()

2021-04-09 Thread Theodore Ts'o
On Thu, Apr 08, 2021 at 03:00:33PM +0800, Xu Yihang wrote:
> In case of if not ext4_fc_add_tlv branch, an error return code is missing.
> 
> Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
> Reported-by: Hulk Robot 
> Signed-off-by: Xu Yihang 

Thanks, applied.

- Ted


Re: [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit()

2021-04-08 Thread harshad shirwadkar
Thanks, this looks good.

Reviewed-by: Harshad Shirwadkar 

On Thu, Apr 8, 2021 at 12:00 AM Xu Yihang  wrote:
>
> In case of if not ext4_fc_add_tlv branch, an error return code is missing.
>
> Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
> Reported-by: Hulk Robot 
> Signed-off-by: Xu Yihang 
> ---
>  fs/ext4/fast_commit.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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 *), ))
> +   (u8 *), )) {
> +   ret = -ENOSPC;
> goto out;
> +   }
> }
>
> spin_lock(>s_fc_lock);
> --
> 2.17.1
>


[PATCH -next] ext4: fix error return code in ext4_fc_perform_commit()

2021-04-08 Thread Xu Yihang
In case of if not ext4_fc_add_tlv branch, an error return code is missing.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Reported-by: Hulk Robot 
Signed-off-by: Xu Yihang 
---
 fs/ext4/fast_commit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 *), ))
+   (u8 *), )) {
+   ret = -ENOSPC;
goto out;
+   }
}
 
spin_lock(>s_fc_lock);
-- 
2.17.1