From patchwork Tue May 25 23:23:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bmarzins@sourceware.org X-Patchwork-Id: 102311 Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4PNPsxL026855 for ; Tue, 25 May 2010 23:26:30 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PNNOtI025719; Tue, 25 May 2010 19:23:26 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PNNNse015688 for ; Tue, 25 May 2010 19:23:23 -0400 Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.7]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4PNNHlJ026051 for ; Tue, 25 May 2010 19:23:18 -0400 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by mx1.redhat.com (8.13.8/8.13.8) with SMTP id o4PNN8JA015001 for ; Tue, 25 May 2010 19:23:08 -0400 Received: (qmail 18706 invoked by uid 9475); 25 May 2010 23:23:08 -0000 Date: 25 May 2010 23:23:08 -0000 Message-ID: <20100525232308.18704.qmail@sourceware.org> From: bmarzins@sourceware.org To: dm-cvs@sourceware.org, dm-devel@redhat.com X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.7 X-loop: dm-devel@redhat.com Subject: [dm-devel] multipath-tools/libmultipath discovery.c X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 25 May 2010 23:26:30 +0000 (UTC) --- multipath-tools/libmultipath/discovery.c 2008/04/14 17:59:54 1.28.2.7 +++ multipath-tools/libmultipath/discovery.c 2010/05/25 23:23:07 1.28.2.8 @@ -553,6 +553,21 @@ if (0 <= readattr(attr_path, attr_buff) && strlen(attr_buff) > 0) strncpy(curpath->tgt_node_name, attr_buff, strlen(attr_buff) - 1); + else { + if(safe_sprintf(attr_path, + "%s/class/iscsi_transport/target%i:%i:%i/target_name", + sysfs_path, + curpath->sg_id.host_no, + curpath->sg_id.channel, + curpath->sg_id.scsi_id)) { + condlog(0, "attr_path too small"); + return 1; + } + if (0 <= readattr(attr_path, attr_buff) && + strlen(attr_buff) > 0) + strncpy(curpath->tgt_node_name, attr_buff, + strlen(attr_buff) - 1); + } condlog(3, "tgt_node_name = %s", curpath->tgt_node_name); return 0;