  
  	if (S_ISREG(inode->i_mode))
  		;
---- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c	2015-08-24 16:13:26.481924679 +0530
-+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.c	2015-08-24 17:33:50.950490156 +0530
-@@ -986,7 +986,11 @@ static void scsi_cmnd_start(struct iscsi
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c iscsitarget-1.4.20.3+svn502/kernel/iscsi.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c	2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.c	2017-01-18 23:37:36.462970326 -0800
+@@ -489,8 +489,12 @@ static void cmnd_skip_pdu(struct iscsi_c
+ 	}
+ 	conn->read_iov[i].iov_base = addr;
+ 	conn->read_iov[i].iov_len = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++	iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
++#else
+ 	conn->read_msg.msg_iov = conn->read_iov;
+ 	conn->read_msg.msg_iovlen = ++i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+ 
+ static void iscsi_cmnd_reject(struct iscsi_cmnd *req, int reason)
+@@ -718,7 +722,9 @@ static int cmnd_recv_pdu(struct iscsi_co
+ 	idx = offset >> PAGE_CACHE_SHIFT;
+ 	offset &= ~PAGE_CACHE_MASK;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 	conn->read_msg.msg_iov = conn->read_iov;
++#endif	/* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 	conn->read_size = size = (size + 3) & -4;
+ 	conn->read_overflow = 0;
+ 
+@@ -730,16 +736,25 @@ static int cmnd_recv_pdu(struct iscsi_co
+ 		conn->read_iov[i].iov_base =  addr + offset;
+ 		if (offset + size <= PAGE_CACHE_SIZE) {
+ 			conn->read_iov[i].iov_len = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++			iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
++#else
+ 			conn->read_msg.msg_iovlen = ++i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 			break;
+ 		}
+ 		conn->read_iov[i].iov_len = PAGE_CACHE_SIZE - offset;
+ 		size -= conn->read_iov[i].iov_len;
+ 		offset = 0;
+ 		if (++i >= ISCSI_CONN_IOV_MAX) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 			conn->read_msg.msg_iovlen = i;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 			conn->read_overflow = size;
+ 			conn->read_size -= size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++			iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 			break;
+ 		}
+ 
+@@ -918,7 +933,9 @@ static int nop_out_start(struct iscsi_co
+ 
+ 	if ((size = cmnd->pdu.datasize)) {
+ 		size = (size + 3) & -4;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ 		conn->read_msg.msg_iov = conn->read_iov;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ 		if (cmnd->pdu.bhs.itt != cpu_to_be32(ISCSI_RESERVED_TAG)) {
+ 			struct tio *tio;
+ 			int pg_cnt = get_pgcnt(size);
+@@ -946,7 +963,11 @@ static int nop_out_start(struct iscsi_co
+ 		}
+ 		assert(!size);
+ 		conn->read_overflow = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++		iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
++#else
+ 		conn->read_msg.msg_iovlen = i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ 	}
+ 
+ out:
+@@ -986,7 +1007,11 @@ static void scsi_cmnd_start(struct iscsi
  		set_cmnd_lunit(req);
  
  	switch (req_hdr->scb[0]) {

 		if ((req_hdr->scb[1] & 0x1f) != 0x10)
 			goto error;
 	case INQUIRY:
--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h	2015-08-24 16:13:26.481924679 +0530
+++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h	2015-08-24 17:35:31.354690051 +0530
@@ -257,7 +257,11 @@ struct iscsi_conn {
 	struct timer_list nop_timer;
 
 	struct iscsi_cmnd *read_cmnd;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+	struct user_msghdr read_msg;
+#else
 	struct msghdr read_msg;
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
 	struct iovec read_iov[ISCSI_CONN_IOV_MAX];
 	u32 read_size;
 	u32 read_overflow;
--- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c	2015-08-24 16:13:26.481924679 +0530
+++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c	2015-08-24 17:41:56.187428925 +0530
@@ -80,8 +80,11 @@ static int is_data_available(struct iscs
 	set_fs(oldfs);
 	return (res >= 0) ? avail : res;
 }
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+static void forward_iov(struct user_msghdr *msg, int len)
+#else
 static void forward_iov(struct msghdr *msg, int len)
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
 {
 	while (msg->msg_iov->iov_len <= len) {
 		len -= msg->msg_iov->iov_len;
@@ -96,7 +99,11 @@ static void forward_iov(struct msghdr *m
 static int do_recv(struct iscsi_conn *conn, int state)
 {
 	mm_segment_t oldfs;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+	struct user_msghdr msg;
+#else
 	struct msghdr msg;
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
 	struct iovec iov[ISCSI_CONN_IOV_MAX];
 	int i, len, res;
 
@@ -461,7 +468,11 @@ static void exit_tx(struct iscsi_conn *c
 static int tx_ddigest(struct iscsi_cmnd *cmnd, int state)
 {
 	int res, rest = cmnd->conn->write_size;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+	struct user_msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT};
+#else
 	struct msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT};
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
 	struct kvec iov;
 
 	iov.iov_base = (char *) (&cmnd->ddigest) + (sizeof(u32) - rest);
--- iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c	2015-08-24 16:13:26.481924679 +0530
+++ iscsitarget-1.4.20.3+svn502/kernel/target_disk.c	2015-08-24 17:43:42.167625159 +0530
@@ -606,7 +606,11 @@ static int disk_execute_cmnd(struct iscs
 	case REQUEST_SENSE:
 		send_data_rsp(cmnd, build_request_sense_response);

+	case SERVICE_ACTION_IN_16:
+#else
 	case SERVICE_ACTION_IN:
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
 		send_data_rsp(cmnd, build_service_action_in_response);
 		break;
 	case READ_6:
diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
--- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c	2014-05-06 13:59:55.000000000 -0700
+++ iscsitarget-1.4.20.3+svn502/kernel/volume.c	2017-01-18 23:47:07.957561600 -0800
@@ -398,7 +398,11 @@ int is_volume_reserved(struct iet_volume
 		case READ_CAPACITY:
 			/* allowed commands when reserved */
 			break;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+		case SERVICE_ACTION_IN_16:
+#else
 		case SERVICE_ACTION_IN:
