From: "Busch, Keith" <keith.busch@intel.com>
To: Sagi Grimberg <sagig@dev.mellanox.co.il>
Cc: Christoph Hellwig <hch@lst.de>,
axboe@fb.com, jay.e.sternberg@intel.com,
linux-nvme@lists.infradead.org, phil.cayton@intel.com,
stable@vger.kernel.org, james_p_freyensee@linux.intel.com,
mlin@kernel.org
Subject: Re: [PATCH 01/18] nvme: add missing unmaps in nvme_queue_rq
Date: Tue, 20 Oct 2015 14:07:58 +0000 [thread overview]
Message-ID: <20151020140758.GB22742@localhost.localdomain> (raw)
In-Reply-To: <562611A8.1060804@dev.mellanox.co.il>
On Tue, Oct 20, 2015 at 01:04:24PM +0300, Sagi Grimberg wrote:
> On 10/16/2015 8:58 AM, Christoph Hellwig wrote:
> > sg_init_table(iod->meta_sg, 1);
> > if (blk_rq_map_integrity_sg(
> >- req->q, req->bio, iod->meta_sg) != 1)
> >+ req->q, req->bio, iod->meta_sg) != 1) {
> >+ dma_unmap_sg(dev->dev, iod->sg, iod->nents,
> >+ dma_dir);
> > goto error_cmd;
> >+ }
>
> This is not related to the patch itself. But this condition seems bogus
> to me. We passed meta_sg that consists of a single entry. If we
> happened to map more than a single entry we're already in trouble as we
> overrun meta_sg (modified the iod->sg pointer).
>
> I think a WARN_ON_ONCE statement is more suitable here (which should
> probably come as a separate patch).
We are in trouble if it maps more than 1, but I think the condition
here is intended to guard against 0 rather than > 1. We should already
be ensured it won't be > 1 from a previous check.
Based on the implementation of blk_rq_map_integrity_sg and the functions
earlier setup, I don't think we can ever see 0 here either.
prev parent reply other threads:[~2015-10-20 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1444975128-8768-1-git-send-email-hch@lst.de>
2015-10-16 5:58 ` [PATCH 01/18] nvme: add missing unmaps in nvme_queue_rq Christoph Hellwig
2015-10-20 10:04 ` Sagi Grimberg
2015-10-20 14:07 ` Busch, Keith [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=20151020140758.GB22742@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=james_p_freyensee@linux.intel.com \
--cc=jay.e.sternberg@intel.com \
--cc=linux-nvme@lists.infradead.org \
--cc=mlin@kernel.org \
--cc=phil.cayton@intel.com \
--cc=sagig@dev.mellanox.co.il \
--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