From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yangtao Li <frank.li@vivo.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: remove submit label in __submit_discard_cmd()
Date: Mon, 14 Nov 2022 14:49:17 -0800 [thread overview]
Message-ID: <Y3LF7SjCLKaz7OWi@google.com> (raw)
In-Reply-To: <20221111161349.60689-1-frank.li@vivo.com>
On 11/12, Yangtao Li wrote:
> Complaint from Matthew Wilcox in another similar place:
>
> "submit? You don't submit anything at the 'submit' label.
> it should be called 'skip' or something. But I think this
> is just badly written and you don't need a goto at all."
>
> Let's remove submit label for readability.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> fs/f2fs/segment.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 3654c30e0517..0a72e787c585 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1144,13 +1144,11 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
> if (time_to_inject(sbi, FAULT_DISCARD)) {
> f2fs_show_injection_info(sbi, FAULT_DISCARD);
> err = -EIO;
> - goto submit;
> - }
> - err = __blkdev_issue_discard(bdev,
> + } else
> + err = __blkdev_issue_discard(bdev,
> SECTOR_FROM_BLOCK(start),
> SECTOR_FROM_BLOCK(len),
> GFP_NOFS, &bio);
Thanks. I added {} to meet the coding style.
> -submit:
> if (err) {
> spin_lock_irqsave(&dc->lock, flags);
> if (dc->state == D_PARTIAL)
> --
> 2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yangtao Li <frank.li@vivo.com>
Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] f2fs: remove submit label in __submit_discard_cmd()
Date: Mon, 14 Nov 2022 14:49:17 -0800 [thread overview]
Message-ID: <Y3LF7SjCLKaz7OWi@google.com> (raw)
In-Reply-To: <20221111161349.60689-1-frank.li@vivo.com>
On 11/12, Yangtao Li wrote:
> Complaint from Matthew Wilcox in another similar place:
>
> "submit? You don't submit anything at the 'submit' label.
> it should be called 'skip' or something. But I think this
> is just badly written and you don't need a goto at all."
>
> Let's remove submit label for readability.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> fs/f2fs/segment.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 3654c30e0517..0a72e787c585 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1144,13 +1144,11 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
> if (time_to_inject(sbi, FAULT_DISCARD)) {
> f2fs_show_injection_info(sbi, FAULT_DISCARD);
> err = -EIO;
> - goto submit;
> - }
> - err = __blkdev_issue_discard(bdev,
> + } else
> + err = __blkdev_issue_discard(bdev,
> SECTOR_FROM_BLOCK(start),
> SECTOR_FROM_BLOCK(len),
> GFP_NOFS, &bio);
Thanks. I added {} to meet the coding style.
> -submit:
> if (err) {
> spin_lock_irqsave(&dc->lock, flags);
> if (dc->state == D_PARTIAL)
> --
> 2.25.1
next prev parent reply other threads:[~2022-11-14 22:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 16:13 [f2fs-dev] [PATCH] f2fs: remove submit label in __submit_discard_cmd() Yangtao Li via Linux-f2fs-devel
2022-11-11 16:13 ` Yangtao Li
2022-11-14 22:49 ` Jaegeuk Kim [this message]
2022-11-14 22:49 ` Jaegeuk Kim
2022-11-15 1:36 ` [f2fs-dev] " Chao Yu
2022-11-15 1:36 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3LF7SjCLKaz7OWi@google.com \
--to=jaegeuk@kernel.org \
--cc=frank.li@vivo.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.