Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit()
@ 2021-04-08  7:00 Xu Yihang
  2021-04-08 16:26 ` harshad shirwadkar
  2021-04-10  1:28 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Yihang @ 2021-04-08  7:00 UTC (permalink / raw)
  To: tytso, adilger.kernel, harshadshirwadkar, linux-ext4, linux-kernel
  Cc: xuyihang

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 <hulkci@huawei.com>
Signed-off-by: Xu Yihang <xuyihang@huawei.com>
---
 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 *)&head, &crc))
+			(u8 *)&head, &crc)) {
+			ret = -ENOSPC;
 			goto out;
+		}
 	}
 
 	spin_lock(&sbi->s_fc_lock);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit()
  2021-04-08  7:00 [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit() Xu Yihang
@ 2021-04-08 16:26 ` harshad shirwadkar
  2021-04-10  1:28 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: harshad shirwadkar @ 2021-04-08 16:26 UTC (permalink / raw)
  To: Xu Yihang
  Cc: Theodore Y. Ts'o, Andreas Dilger, Ext4 Developers List, linux-kernel

Thanks, this looks good.

Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>

On Thu, Apr 8, 2021 at 12:00 AM Xu Yihang <xuyihang@huawei.com> 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 <hulkci@huawei.com>
> Signed-off-by: Xu Yihang <xuyihang@huawei.com>
> ---
>  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 *)&head, &crc))
> +                       (u8 *)&head, &crc)) {
> +                       ret = -ENOSPC;
>                         goto out;
> +               }
>         }
>
>         spin_lock(&sbi->s_fc_lock);
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit()
  2021-04-08  7:00 [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit() Xu Yihang
  2021-04-08 16:26 ` harshad shirwadkar
@ 2021-04-10  1:28 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2021-04-10  1:28 UTC (permalink / raw)
  To: Xu Yihang; +Cc: adilger.kernel, harshadshirwadkar, linux-ext4, linux-kernel

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 <hulkci@huawei.com>
> Signed-off-by: Xu Yihang <xuyihang@huawei.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08  7:00 [PATCH -next] ext4: fix error return code in ext4_fc_perform_commit() Xu Yihang
2021-04-08 16:26 ` harshad shirwadkar
2021-04-10  1:28 ` Theodore Ts'o

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git