From: Bart Van Assche <bvanassche@acm.org>
To: Wang Yufen <wangyufen@huawei.com>,
jgg@ziepe.ca, leon@kernel.org,
dennis.dalessandro@cornelisnetworks.com
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
andriy.shevchenko@linux.intel.com, bart.vanassche@wdc.com,
easwar.hariharan@intel.com
Subject: Re: [PATCH v4 2/2] RDMA/srp: Fix error return code in srp_parse_options()
Date: Tue, 29 Nov 2022 10:43:53 -0800 [thread overview]
Message-ID: <b4d78eb0-4492-ac7f-d500-3d49b0dc7aa1@acm.org> (raw)
In-Reply-To: <1669687459-14180-2-git-send-email-wangyufen@huawei.com>
On 11/28/22 18:04, Wang Yufen wrote:
> In the previous while loop, "ret" may be assigned zero, , so the error
The word "iteration" is missing from the above sentence. Additionally,
there is a double comma.
> return code may be incorrectly set to 0 instead of -EINVAL. Alse
Alse -> Also
> case SRP_OPT_QUEUE_SIZE:
> - if (match_int(args, &token) || token < 1) {
> + ret = match_int(args, &token);
> + if (ret)
> + goto out;
> + if (token < 1) {
> pr_warn("bad queue_size parameter '%s'\n", p);
> + ret = -EINVAL;
> goto out;
> }
> target->scsi_host->can_queue = token;
Why only to report "bad queue_size parameter" if ret == 0 && token < 1
but not if ret < 0? This is a behavior change that has not been
explained in the patch description.
> @@ -3490,25 +3496,34 @@ static int srp_parse_options(struct net *net, const char *buf,
> break;
>
> case SRP_OPT_MAX_CMD_PER_LUN:
> - if (match_int(args, &token) || token < 1) {
> + ret = match_int(args, &token);
> + if (ret)
> + goto out;
> + if (token < 1) {
> pr_warn("bad max cmd_per_lun parameter '%s'\n",
> p);
> + ret = -EINVAL;
> goto out;
> }
> target->scsi_host->cmd_per_lun = token;
> break;
Same comment here and for many other changes below.
Thanks,
Bart.
next prev parent reply other threads:[~2022-11-29 18:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 2:04 [PATCH v4 1/2] RDMA/hfi1: Fix error return code in parse_platform_config() Wang Yufen
2022-11-29 2:04 ` [PATCH v4 2/2] RDMA/srp: Fix error return code in srp_parse_options() Wang Yufen
2022-11-29 18:43 ` Bart Van Assche [this message]
2022-11-30 3:31 ` wangyufen
2022-11-30 18:00 ` Bart Van Assche
2022-12-01 1:37 ` wangyufen
2022-12-01 1:49 ` wangyufen
2022-12-01 12:21 ` Andy Shevchenko
2022-11-29 8:56 ` [PATCH v4 1/2] RDMA/hfi1: Fix error return code in parse_platform_config() Leon Romanovsky
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=b4d78eb0-4492-ac7f-d500-3d49b0dc7aa1@acm.org \
--to=bvanassche@acm.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bart.vanassche@wdc.com \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=easwar.hariharan@intel.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=wangyufen@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox