From patchwork Mon Jun 20 17:53:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 897952 X-Patchwork-Delegate: dave@thedillows.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5KHrcix028306 for ; Mon, 20 Jun 2011 17:53:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755222Ab1FTRxh (ORCPT ); Mon, 20 Jun 2011 13:53:37 -0400 Received: from mail-vx0-f174.google.com ([209.85.220.174]:50903 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003Ab1FTRxh convert rfc822-to-8bit (ORCPT ); Mon, 20 Jun 2011 13:53:37 -0400 Received: by vxb39 with SMTP id 39so1103836vxb.19 for ; Mon, 20 Jun 2011 10:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=XIDbMNSPAr3kBY2xWi9AOoOSbbe6tj5zJnaeO0/thVw=; b=kyX6BbXzLlIdzGcBeSbbDPuXDdVEz4noyKVOgNrZWSc7DcKITxLdDbTJHGm3UNNyc5 sV5Dk+BJ/epFPhH7eD1JpfWByiuqyG/TJ9M/AmPKqF4mYgaJ4tV58cx1rQr5uu72kriG s7ATgCYcbtlWB8ZnRe8SQIedQXlJh7ecf5t+Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=M9eOwhn6g8W22YQjLbN+q5WCpjrtMV5G6lkEJKsNqWPqgbMxRQCk8dzm+bC2MLEko5 cedaVDt02pAUmn104TaVFIl3lexiSzPqS9jx3X5oXQ/7nw+9KuSagG1kxSvpAPpM1qhB aQoVJSiS68BXrhT7BwqZ+QUlJTGRnoPh+LXuk= Received: by 10.52.98.36 with SMTP id ef4mr4622643vdb.70.1308592416180; Mon, 20 Jun 2011 10:53:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.161.68 with HTTP; Mon, 20 Jun 2011 10:53:16 -0700 (PDT) In-Reply-To: <20110620113736.GA406@infradead.org> References: <201106191348.24122.bvanassche@acm.org> <1308504469.14467.5.camel@obelisk.thedillows.org> <20110620113736.GA406@infradead.org> From: Bart Van Assche Date: Mon, 20 Jun 2011 19:53:16 +0200 X-Google-Sender-Auth: 4YoUCZGrw-ajzFlD9QvBk99XFKk Message-ID: Subject: Re: [PATCH 1/2] IB/srp: Fix SCSI scanning To: Christoph Hellwig Cc: David Dillow , linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org, Roland Dreier , Brian King Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 20 Jun 2011 17:53:39 +0000 (UTC) On Mon, Jun 20, 2011 at 1:37 PM, Christoph Hellwig wrote: > We really shouldn't require workaround for this in every SCSI driver. > > scsi_scan_host_selected already makes sure never to scan above > shost->max_channel.  Could it be that you don't have that one set > properly in the srp driver?  It not we'll need to debug why it happens > instead of adding hacks like this. As far as I can see the default value for max_channel is zero. The patch below also avoids creation of duplicate SCSI targets on my setup. Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srp/ib_srp.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index ee165fd..4ab1271 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2127,6 +2127,7 @@ static ssize_t srp_create_target(struct device *dev, return -ENOMEM; target_host->transportt = ib_srp_transport_template; + target_host->max_id = 1; target_host->max_lun = SRP_MAX_LUN; target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;