From patchwork Tue Oct 6 16:27:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 7337191 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23B9EBF90C for ; Tue, 6 Oct 2015 16:27:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5738A2073B for ; Tue, 6 Oct 2015 16:27:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7ADCB20738 for ; Tue, 6 Oct 2015 16:27:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751829AbbJFQ1x (ORCPT ); Tue, 6 Oct 2015 12:27:53 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36639 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752599AbbJFQ1x (ORCPT ); Tue, 6 Oct 2015 12:27:53 -0400 Received: by wicgb1 with SMTP id gb1so173417482wic.1 for ; Tue, 06 Oct 2015 09:27:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=qWa7Wp9dcBDGTGQS5z4lqvlwMN6wWlgLNXT9meLyXpY=; b=f7H9RRvY3Y6LhY5cS3KYvXHMrXVuS6tj5VqLXhBGSh0753VSOpinYl7FVs87ErqcZQ DefkUapaaUxyyFdi2mUkLR8EEj+RQLdkmN2iR3vh9r0SPekfB7UHjg/spMy/uGvhSy9z XcZGBTjWV9yqvXMZwEftJxCNCqio13UsH/Xo1jF2EwPA3y+4rQ8GSkF8Jog8Ga0b+1J/ pOzG99g+9RsOmkvB2bJoZsx6h2RHmuegHEQq9EjCTBvi7wzDlTs2IC1TK8Ct4EKCQINs admc77lO2Gu3GnKZYyoaaSHEmg57TJNcbz+c3erD4W5v7dWGAw+wMwGKfYMAFHAu/mzT /wnQ== X-Gm-Message-State: ALoCoQkG3iHbp6XIyyrAr3YZjnjuHJjEpzKcoj0cGgJwxh/AEy+m/IYb7B5qK0uf2B/WnWYhPUJ7 X-Received: by 10.180.107.130 with SMTP id hc2mr17297390wib.92.1444148871926; Tue, 06 Oct 2015 09:27:51 -0700 (PDT) Received: from [192.168.1.101] ([87.69.91.8]) by smtp.googlemail.com with ESMTPSA id l1sm33468133wjx.13.2015.10.06.09.27.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2015 09:27:51 -0700 (PDT) Subject: Re: [PATCH rdma-rc] xprtrdma: Don't require LOCAL_DMA_LKEY support for fasterg To: Chuck Lever , Sagi Grimberg References: <1444124889-8957-1-git-send-email-sagig@mellanox.com> <56C57483-17AA-47FF-8743-E1522BD8C351@oracle.com> Cc: linux-rdma@vger.kernel.org, Linux NFS Mailing List From: Sagi Grimberg Message-ID: <5613F684.3020904@dev.mellanox.co.il> Date: Tue, 6 Oct 2015 19:27:48 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56C57483-17AA-47FF-8743-E1522BD8C351@oracle.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/6/2015 6:05 PM, Chuck Lever wrote: > Hi Sagi- > > >> On Oct 6, 2015, at 5:48 AM, Sagi Grimberg wrote: >> >> There is no need to require LOCAL_DMA_LKEY support in order to >> use fast registration as the PD allocation makes sure that there >> is a local_dma_lkey. > > In other words, all devices now have a local DMA lkey, so the > check is unnecessary. Right. > > >> This caused a NULL pointer dereference in mlx5 which removed >> the support for LOCAL_DMA_LKEY. > > Where was the bad dereference? in mlx5, or in xprtrdma? xprtrdma, ia->ri_ops wasn't assigned correctly. Now that I look at it, one error path in rpcrdma_ia_open misses an rc assignment. That needs to be fixed too, should it be in the same patch? } --- the incorrect requirement + missing rc caused the NULL deref of ia->ri_ops. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 7efd9ef..81e8d31 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -554,6 +554,7 @@ rpcrdma_ia_open(struct rpcrdma_xprt *xprt, struct sockaddr *addr, int memreg) if (!ia->ri_device->alloc_fmr) { dprintk("RPC: %s: MTHCAFMR registration " "not supported by HCA\n", __func__); + rc = -EINVAL; goto out3; }