Message ID | 1456938434-20387-5-git-send-email-hch@lst.de (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Jens Axboe |
Headers | show |
On Wed, Mar 02, 2016 at 06:07:13PM +0100, Christoph Hellwig wrote: > Driver private request types should not get the artifical cap for the > FS requests. This is important to use the full device capabilities > for internal command or NVMe pass through commands. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > Reported-by: Jeff Lien <Jeff.Lien@hgst.com> > Tested-by: Jeff Lien <Jeff.Lien@hgst.com> > --- Looks good if we can depend on the enum order. Maybe a more explicit check for the one type that does support checking chunk sectors instead: if (unlikely(rq->cmd_type != REQ_TYPE_FS)) But it looks fine as-is, too. Reviewed-by: Keith Busch <keith.busch@intel.com> -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Mar 02, 2016 at 07:17:05PM +0000, Keith Busch wrote: > check for the one type that does support checking chunk sectors instead: > > if (unlikely(rq->cmd_type != REQ_TYPE_FS)) > > But it looks fine as-is, too. Yes, that's probably better in the long run. Jens, can you fold the suggestion from Keith into the patch? -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 03/02/2016 02:18 PM, Christoph Hellwig wrote: > On Wed, Mar 02, 2016 at 07:17:05PM +0000, Keith Busch wrote: >> check for the one type that does support checking chunk sectors instead: >> >> if (unlikely(rq->cmd_type != REQ_TYPE_FS)) >> >> But it looks fine as-is, too. > > Yes, that's probably better in the long run. Jens, can you fold the > suggestion from Keith into the patch? Too late to fold, but I fixed it separately.
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d7f6bca..f831dc0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -895,7 +895,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq) { struct request_queue *q = rq->q; - if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC)) + if (unlikely(rq->cmd_type >= REQ_TYPE_BLOCK_PC)) return q->limits.max_hw_sectors; if (!q->limits.chunk_sectors || (rq->cmd_flags & REQ_DISCARD))