All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: Tao Ma <tm@tao.ma>, Meelis Roos <mroos@linux.ee>,
	axboe@kernel.dk, Tao Ma <boyu.mt@taobao.com>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org,
	Ed Nadolski <edmund.nadolski@intel.com>
Subject: Re: [PATCH] block: fix blk_queue_end_tag()
Date: Wed, 21 Dec 2011 06:20:29 -0700	[thread overview]
Message-ID: <20111221132029.GK20129@parisc-linux.org> (raw)
In-Reply-To: <CABE8wwtrq=SuuhAvNDjpSbfPGE+N4cWjjmVGWq8UzaH6sM9kRg@mail.gmail.com>

On Tue, Dec 20, 2011 at 11:30:14PM -0800, Williams, Dan J wrote:
> @@ -284,16 +284,7 @@ void blk_queue_end_tag(struct request_queue *q,
> struct request *rq)
>         struct blk_queue_tag *bqt = q->queue_tags;
>         int tag = rq->tag;
> 
> -       BUG_ON(tag == -1);
> -
> -       if (unlikely(tag >= bqt->max_depth)) {
> -               /*
> -                * This can happen after tag depth has been reduced.
> -                * But tag shouldn't be larger than real_max_depth.
> -                */
> -               WARN_ON(tag >= bqt->real_max_depth);
> -               return;
> -       }
> +       BUG_ON(tag == -1 || tag > bqt->real_max_depth);

or ...

-	int tag = rq->tag;
+	unsigned tag = rq->tag;
+	BUG_ON(tag >= bqt->real_max_depth);

since tags in the range INT_MIN to -2 are also a bug, right?

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2011-12-21 13:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 23:33 [PATCH] block: fix blk_queue_end_tag() Dan Williams
2011-12-21  6:33 ` Tao Ma
2011-12-21  6:36   ` Meelis Roos
2011-12-21  6:48     ` Tao Ma
2011-12-21  7:30       ` Williams, Dan J
2011-12-21  8:16         ` Tao Ma
2011-12-21  8:22           ` Williams, Dan J
2011-12-21 10:05             ` Jens Axboe
2011-12-21 13:20         ` Matthew Wilcox [this message]
2011-12-21 17:37           ` Williams, Dan J

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=20111221132029.GK20129@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=axboe@kernel.dk \
    --cc=boyu.mt@taobao.com \
    --cc=dan.j.williams@intel.com \
    --cc=edmund.nadolski@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=tm@tao.ma \
    /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.