Re: [RFC] Add source address binding to iSER

2019-02-06 Thread Nikhil Valluru
Hi Robert,

I am looking for a similar fix and wanted to know if this patch was 
accepted into the linux kernel? 

Thanks,
Nikhil

On Friday, 2 June 2017 19:20:52 UTC-4, Robert LeBlanc wrote:
>
> The error that I was getting was due to the distro version of iscsid 
> running. Once I stopped that and ran iscsid from the patched source, 
> it logged in just fine. 
>  
> Robert LeBlanc 
> PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1 
>
>
> On Fri, Jun 2, 2017 at 2:29 PM, Robert LeBlanc  > wrote: 
> > Attaching patches in case they are mangled. 
> >  
> > Robert LeBlanc 
> > PGP Fingerprint 79A2 9CA4 6CC4 45DD A904  C70E E654 3BB2 FA62 B9F1 
> > 
> > 
> > On Fri, Jun 2, 2017 at 1:13 PM, Robert LeBlanc  > wrote: 
> >> First off, I've never done anything this complicated, please be gentle. 
> >> 
> >> Second, I know this will need to be broken up, but I'm not clear if 
> >> each commit should be able to compile. It seems having a commit for 
> >> each driver would make sense, but it won't compile cleanly without the 
> >> others. How do I go about that? 
> >> 
> >> Third, this required a change to the kernel API(?) and I'm not sure 
> >> the best way to to make that change backwards compatible. 
> >> 
> >> Forth, I'm getting an error on login. I don't think the kernel is even 
> >> trying the login. Maybe I can get a pointer to help me get this 
> >> resolved. 
> >> 
> >> # usr/iscsiadm -m iface -I iser3 
> >> # BEGIN RECORD 2.0-874 
> >> iface.iscsi_ifacename = iser3 
> >> iface.net_ifacename =  
> >> iface.ipaddress = fd00::14 
> >> ... 
> >> # usr/iscsiadm -m iface -I iser4 
> >> # BEGIN RECORD 2.0-874 
> >> iface.iscsi_ifacename = iser4 
> >> iface.net_ifacename =  
> >> iface.ipaddress = fd00::114 
> >> ... 
> >> # usr/iscsiadm -m discovery -t st -p fd00::13 -I iser3 -I iser4 
> >> [fd00::13]:3260,1 iqn.2016-12.com.betterservers 
> >> [fd00::13]:3260,1 iqn.2016-12.com.betterservers 
> >> # usr/iscsiadm -m node -T iqn.2016-12.com.betterservers -p 
> [fd00::13]:3260 -l 
> >> Logging in to [iface: iser3, target: iqn.2016-12.com.betterservers, 
> >> portal: fd00::13,3260] (multiple) 
> >> Logging in to [iface: iser4, target: iqn.2016-12.com.betterservers, 
> >> portal: fd00::13,3260] (multiple) 
> >> iscsiadm: Could not login to [iface: iser3, target: 
> >> iqn.2016-12.com.betterservers, portal: fd00::13,3260]. 
> >> iscsiadm: initiator reported error (12 - iSCSI driver not found. 
> >> Please make sure it is loaded, and retry the operation) 
> >> iscsiadm: Could not login to [iface: iser4, target: 
> >> iqn.2016-12.com.betterservers, portal: fd00::13,3260]. 
> >> iscsiadm: initiator reported error (12 - iSCSI driver not found. 
> >> Please make sure it is loaded, and retry the operation) 
> >> iscsiadm: Could not log into all portals 
> >> 
> >> Patch to open-iscsi 
> >>  
> >> diff --git a/usr/netlink.c b/usr/netlink.c 
> >> index 1a0bf80..c474375 100644 
> >> --- a/usr/netlink.c 
> >> +++ b/usr/netlink.c 
> >> @@ -848,10 +848,13 @@ krecv_pdu_end(struct iscsi_conn *conn) 
> >>  int 
> >>  ktransport_ep_connect(iscsi_conn_t *conn, int non_blocking) 
> >>  { 
> >> -int rc, addrlen; 
> >> +int rc, addrlen = sizeof(struct sockaddr_storage); 
> >>  struct iscsi_uevent *ev; 
> >> -struct sockaddr *dst_addr = (struct sockaddr *)>saddr; 
> >> +struct sockaddr_storage *dst_addr = (struct sockaddr_storage 
> >> *)>saddr; 
> >>  struct iovec iov[2]; 
> >> +struct iscsi_session *tmp_session = (struct iscsi_session 
> >> *)conn->session; 
> >> +node_rec_t *tmp_rec = (node_rec_t *)_session->nrec; 
> >> +iface_rec_t *tmp_iface = (iface_rec_t *)_rec->iface; 
> >> 
> >>  log_debug(7, "in %s", __FUNCTION__); 
> >> 
> >> @@ -868,19 +871,16 @@ ktransport_ep_connect(iscsi_conn_t *conn, int 
> >> non_blocking) 
> >>  ev->u.ep_connect.non_blocking = non_blocking; 
> >>  } 
> >> 
> >> -if (dst_addr->sa_family == PF_INET) 
> >> -addrlen = sizeof(struct sockaddr_in); 
> >> -else if (dst_addr->sa_family == PF_INET6) 
> >> -addrlen = sizeof(struct sockaddr_in6); 
> >> -else { 
> >> +if (dst_addr->ss_family != AF_INET && dst_addr->ss_family != 
> >> AF_INET6) { 
> >>  log_error("%s unknown addr family %d", 
> >> - __FUNCTION__, dst_addr->sa_family); 
> >> + __FUNCTION__, dst_addr->ss_family); 
> >>  return -EINVAL; 
> >>  } 
> >>  memcpy(setparam_buf + sizeof(*ev), dst_addr, addrlen); 
> >> +iface_copy(setparam_buf + sizeof(*ev) + addrlen, tmp_iface); 
> >> 
> >>  iov[1].iov_base = ev; 
> >> -iov[1].iov_len = sizeof(*ev) + addrlen; 
> >> +iov[1].iov_len = sizeof(*ev) + addrlen + sizeof(iface_rec_t); 
> >>  rc = __kipc_call(iov, 2); 
> >>  if (rc < 0) 

Re: Error while performing writes using dd or mkfs on iSCSI initiator.

2019-02-06 Thread The Lee-Man
On Wednesday, January 23, 2019 at 1:48:19 PM UTC-8, iamlinonym...@gmail.com 
wrote:
>
> We have a LIO target on RHEL 7.5 with the lun created using fileio through 
> targetcli. We exported it
> to RHEL initiator on the same box (Tried with other box as well). 
> On the lun, when we do mkfs for ext3/ext4, it fails with following message 
> and can not be mounted.
>
>
> -
> [root@linux_machine /]# mkfs -t ext4 /dev/sdh
> mke2fs 1.42.9 (28-Dec-2013)
> /dev/sdh is entire device, not just one partition!
> Proceed anyway? (y,n) y
> Filesystem label=
> OS type: Linux
> Block size=4096 (log=2)
> Fragment size=4096 (log=2)
> Stride=0 blocks, Stripe width=1024 blocks
> 2621440 inodes, 10485760 blocks
> 524288 blocks (5.00%) reserved for the super user
> First data block=0
> Maximum filesystem blocks=2157969408
> 320 block groups
> 32768 blocks per group, 32768 fragments per group
> 8192 inodes per group
> Superblock backups stored on blocks:
> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 
> 2654208,
> 4096000, 7962624
>
> Allocating group tables: done
> Writing inode tables: done
> Creating journal (32768 blocks): done
> Writing superblocks and filesystem accounting information:
> Warning, had trouble writing out superblocks.
>
> -
> while above task fails, /var/log/messages on initiator has following 
> errors.
>
>
> -
> kernel: connection1:0: detected conn error (1020)
> Kernel reported iSCSI connection 1:0 error (1020 - 
> ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (3)
> connection1:0 is operational after recovery (1 attempts)
> connection1:0: detected conn error (1020)
> Kernel reported iSCSI connection 1:0 error (1020 - 
> ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed) state (3)
> connection1:0 is operational after recovery (1 attempts)
> connection1:0: detected conn error (1020)
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> kernel: sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 54 00 10 00 10 00 00
> kernel: blk_update_request: I/O error, dev sdf, sector 5505040
> Kernel: Buffer I/O error on dev sdf, logical block 688130, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688131, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688132, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688133, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688134, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688135, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688136, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688137, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688138, lost async page 
> write
> kernel: Buffer I/O error on dev sdf, logical block 688139, lost async page 
> write
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> kernel: sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 50 00 10 00 10 00 00
> kernel: blk_update_request: I/O error, dev sdf, sector 5242896
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> kernel: sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 4c 00 10 00 10 00 00
> kernel: blk_update_request: I/O error, dev sdf, sector 4980752
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 48 00 10 00 10 00 00
> blk_update_request: I/O error, dev sdf, sector 4718608
> sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 44 00 10 00 10 00 00
> blk_update_request: I/O error, dev sdf, sector 4456464
> sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 40 00 10 00 10 00 00
> blk_update_request: I/O error, dev sdf, sector 4194320
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> kernel: sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 3c 00 10 00 10 00 00
> kernel: blk_update_request: I/O error, dev sdf, sector 3932176
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> kernel: sd 7:0:0:1: [sdf] CDB: Write(10) 2a 00 00 38 00 10 00 10 00 00
> kernel: blk_update_request: I/O error, dev sdf, sector 3670032
> kernel: sd 7:0:0:1: [sdf] FAILED Result: hostbyte=DID_TRANSPORT_DISRUPTED 
> driverbyte=DRIVER_OK
> kernel: sd 7:0:0:1: [sdf] CDB: