diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2016-04-12 14:39:18 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-01 12:17:03 -0700 |
commit | f131e8e07c4ff651a4a2508b9f2cc3a52708b9ab (patch) | |
tree | 74f1a8212e1f52e9d62241085d12dd4c538d28ff | |
parent | 61178531d925bf8570ec410e9a7325e916bb44e8 (diff) | |
download | linux-stable-f131e8e07c4ff651a4a2508b9f2cc3a52708b9ab.tar.gz linux-stable-f131e8e07c4ff651a4a2508b9f2cc3a52708b9ab.tar.bz2 linux-stable-f131e8e07c4ff651a4a2508b9f2cc3a52708b9ab.zip |
IB/srp: Fix a debug kernel crash
commit 54f5c9c52d69afa55abf2b034df8d45f588466c3 upstream.
Avoid that the following BUG() is triggered against a debug
kernel:
kernel BUG at include/linux/scatterlist.h:92!
RIP: 0010:[<ffffffffa0467199>] [<ffffffffa0467199>] srp_map_idb+0x199/0x1a0 [ib_srp]
Call Trace:
[<ffffffffa04685fa>] srp_map_data+0x84a/0x890 [ib_srp]
[<ffffffffa0469674>] srp_queuecommand+0x1e4/0x610 [ib_srp]
[<ffffffff813f5a5e>] scsi_dispatch_cmd+0x9e/0x180
[<ffffffff813f8b07>] scsi_request_fn+0x477/0x610
[<ffffffff81298ffe>] __blk_run_queue+0x2e/0x40
[<ffffffff81299070>] blk_delay_work+0x20/0x30
[<ffffffff81071f07>] process_one_work+0x197/0x480
[<ffffffff81072239>] worker_thread+0x49/0x490
[<ffffffff810787ea>] kthread+0xea/0x100
[<ffffffff8159b632>] ret_from_fork+0x22/0x40
Fixes: f7f7aab1a5c0 ("IB/srp: Convert to new registration API")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 03022f6420d7..a09841abae50 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1541,7 +1541,7 @@ static int srp_map_idb(struct srp_rdma_ch *ch, struct srp_request *req, if (dev->use_fast_reg) { state.sg = idb_sg; - sg_set_buf(idb_sg, req->indirect_desc, idb_len); + sg_init_one(idb_sg, req->indirect_desc, idb_len); idb_sg->dma_address = req->indirect_dma_addr; /* hack! */ #ifdef CONFIG_NEED_SG_DMA_LENGTH idb_sg->dma_length = idb_sg->length; /* hack^2 */ |