Re: [PATCH] block: fix blk_queue_end_tag()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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."
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux