From: Bart Van Assche <bvanassche@acm.org>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
James.Bottomley@HansenPartnership.com
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH -next v3] scsi: sd: Fix an incorrect type in 'sd_spinup_disk()'
Date: Tue, 9 Jul 2024 10:59:52 -0700 [thread overview]
Message-ID: <bd27804e-b7bc-4693-90ac-363591ac9467@acm.org> (raw)
In-Reply-To: <20240709093948.9617-1-jiapeng.chong@linux.alibaba.com>
On 7/9/24 2:39 AM, Jiapeng Chong wrote:
> The return value from the call to scsi_execute_cmd() is int. In the
^^^^^
type
> 'else if' branch of the function scsi_execute_cmd, it will return -EINVAL.
> But the type of "the_result" is "unsigned int", causing the error code to
> reverse. Modify the type of "the_result" to solve this problem.
^^^^^^^
What is "reversing an error code"? Did you perhaps mean that the return
value is changed from a negative integer to a positive integer?
> ./drivers/scsi/sd.c:2333:6-16: WARNING: Unsigned expression compared
> with zero: the_result > 0.
Doesn't this patch fix reading uninitialized data? If so, shouldn't that
be mentioned in the patch description?
> Fixes: c1acf38cd11e ("scsi: sd: Have midlayer retry sd_spinup_disk() errors")
Hmm ... that seems incorrect to me. Commit c1acf38cd11e changed the
indentation of "the_result > 0" expressions but did not introduce these.
Is this perhaps the commit that introduced the "the_result > 0"
expressions: ced202f7bd78 ("scsi: core: Stop using DRIVER_ERROR")?
Thanks,
Bart.
prev parent reply other threads:[~2024-07-09 17:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 9:39 Jiapeng Chong
2024-07-09 17:59 ` Bart Van Assche [this message]
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=bd27804e-b7bc-4693-90ac-363591ac9467@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=abaci@linux.alibaba.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®