All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] scsi: Fix a harmless double shift bug
Date: Sat, 08 Dec 2018 03:20:38 +0000	[thread overview]
Message-ID: <yq1pnucln5l.fsf@oracle.com> (raw)
In-Reply-To: <20181129103709.nthxjmmmlb2pdr6g@kili.mountain>


Jens,

This went in through your tree. Can you please pick this fix up?

> On Thu, Nov 29, 2018 at 01:37:10PM +0300, Dan Carpenter wrote:
>> Smatch generates a warning:
>> 
>>     drivers/scsi/scsi_lib.c:1656 scsi_mq_done() warn: test_bit() takes a bit number
>> 
>> The problem is that SCMD_STATE_COMPLETE is supposed to be bit number 0
>> and not a mask like "(1 << 0)".  It is used like this:
>> 
>> 	if (test_and_set_bit(SCMD_STATE_COMPLETE, &scmd->state))
>> 
>> The test_and_set_bit() has a shift built in so it's a double left shift
>> and uses bit number 1 instead of number 0.  This bug is harmless because
>> it's done consistently and it doesn't clash with any other flags.
>> 
>> Fixes: f1342709d18a ("scsi: Do not rely on blk-mq for double completions")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Nice catch, thanks for the fix.
>
> Reviewed-by: Keith Busch <keith.busch@intel.com>

Acked-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2018-12-08  3:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 10:37 [PATCH] scsi: Fix a harmless double shift bug Dan Carpenter
2018-11-29 15:08 ` Keith Busch
2018-12-08  3:20 ` Martin K. Petersen [this message]
2018-12-08  4:25 ` Jens Axboe

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=yq1pnucln5l.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=kernel-janitors@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.