[packages/lin_tape] - up to 3.0.23 - updated patches - added fix for building with kernels 4.15+

baggins baggins at pld-linux.org
Sun Apr 8 01:21:56 CEST 2018


commit fda6bd2d880e4d3fe78be9a0eec8f37d322dc093
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Apr 8 01:19:09 2018 +0200

    - up to 3.0.23
    - updated patches
    - added fix for building with kernels 4.15+

 clean-ifdefs.patch |  28 +++++++++++++-
 kernel-4.15.patch  |  34 +++++++++++++++++
 lin_tape.fixlist   |  13 ++++++-
 lin_tape.spec      |   8 ++--
 linux-4.10.patch   | 106 +++++++++++++++++++++--------------------------------
 linux-4.13.patch   |   2 +-
 linux-4.9.patch    |  21 +++++++----
 7 files changed, 132 insertions(+), 80 deletions(-)
---
diff --git a/lin_tape.spec b/lin_tape.spec
index 3d2d576..43d1605 100644
--- a/lin_tape.spec
+++ b/lin_tape.spec
@@ -5,16 +5,16 @@
 # nothing to be placed to debuginfo package
 %define		_enable_debug_packages	0
 
-%define		rel	3
+%define		rel	1
 %define		pname	lin_tape
 Summary:	IBM Tape SCSI Device Driver for Linux
 Name:		%{pname}%{_alt_kernel}
-Version:	3.0.20
+Version:	3.0.23
 Release:	%{rel}%{?_pld_builder:@%{_kernel_ver_str}}
 License:	GPL v2/LGPL
 Group:		Base/Kernel
 Source0:	%{pname}-%{version}.tgz
-# Source0-md5:	e9780677ade7969498032f10611a3bb6
+# Source0-md5:	38edd3855f4205250cb725df6a8ef2a3
 Source1:	%{pname}.fixlist
 Patch0:		use-module-dir.patch
 Patch1:		clean-ifdefs.patch
@@ -24,6 +24,7 @@ Patch4:		linux-4.11.patch
 Patch5:		linux-4.12.patch
 Patch6:		linux-4.13.patch
 Patch7:		kernel-4.14.patch
+Patch8:		kernel-4.15.patch
 # System Storage, Tape systems, Tape drivers and software, Tape device drivers (Linux)
 URL:		http://www.ibm.com/support/fixcentral/
 BuildRequires:	rpmbuild(macros) >= 1.701
@@ -79,6 +80,7 @@ compatible platforms.\
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 install -p %{SOURCE1} .
 
diff --git a/clean-ifdefs.patch b/clean-ifdefs.patch
index 3d6382a..12db4e9 100644
--- a/clean-ifdefs.patch
+++ b/clean-ifdefs.patch
@@ -20,7 +20,7 @@ diff -ur lin_tape-3.0.18/Makefile lin_tape-3.0.18-ifdefs/Makefile
 diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
 --- lin_tape-3.0.18/pfo.h	2017-02-23 19:14:41.000000000 +0100
 +++ lin_tape-3.0.18-ifdefs/pfo.h	2017-05-09 21:06:34.117699008 +0200
-@@ -26,109 +26,6 @@
+@@ -26,133 +26,6 @@
   * will build for various releases of Linux.  This is how
   * we track different versions using ifdef in the source.
   */
@@ -94,6 +94,18 @@ diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
 -#define BEFORE_RH_71 1
 -#define BEFORE_RH_72 1
 -#endif
+-#ifdef KERNELVERSION_2_6_32_696
+-#define AFTER_RH_62 1
+-#define AFTER_RH_63 1
+-#define AFTER_RH_64 1
+-#define AFTER_RH_65 1
+-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
+-#define AFTER_RH_68 1
+-#define BEFORE_RH_70 1
+-#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
+-#endif
 -#ifdef KERNELVERSION_3_10_0_123
 -#define AFTER_RH_62 1
 -#define AFTER_RH_63 1
@@ -127,13 +139,25 @@ diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
 -#define AFTER_RH_71 1
 -#endif
 -#ifdef KERNELVERSION_3_10_0_514
+-#define AFTER_RH_62 1
+-#define AFTER_RH_63 1
+-#define AFTER_RH_64 1
+-#define AFTER_RH_65 1
+-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
+-#define AFTER_RH_6x 1
+-#define AFTER_RH_70 1
+-#define AFTER_RH_71 1
+-#define AFTER_RH_72 1
+-#endif
+-#ifdef KERNELVERSION_3_10_0_693
  #define AFTER_RH_62 1
  #define AFTER_RH_63 1
  #define AFTER_RH_64 1
 @@ -126,7 +35,6 @@
- #define AFTER_RH_70 1
  #define AFTER_RH_71 1
  #define AFTER_RH_72 1
+ #define AFTER_RH_73 1
 -#endif
  
  /* Misc defines needed so source is same for all versions of Linux */
diff --git a/kernel-4.15.patch b/kernel-4.15.patch
new file mode 100644
index 0000000..15efac9
--- /dev/null
+++ b/kernel-4.15.patch
@@ -0,0 +1,34 @@
+diff -ur lin_tape-3.0.23/upper.c lin_tape-3.0.23.iov/upper.c
+--- lin_tape-3.0.23/upper.c	2018-04-07 22:18:09.417415364 +0200
++++ lin_tape-3.0.23.iov/upper.c	2018-04-07 22:19:26.582769230 +0200
+@@ -388,6 +388,22 @@
+ 	if (hdr->iovec_count) {
+ 		const int size = sizeof(struct sg_iovec) * hdr->iovec_count;
+ 		size_t iov_data_len;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++		struct iov_iter i;
++
++		sg_iov = kmalloc(size, GFP_KERNEL);
++		if (!sg_iov) {
++			ret = -ENOMEM;
++			goto out;
++		}
++
++		ret = import_iovec(hdr->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ, hdr->dxferp, hdr->iovec_count, 0, (struct iovec **)&sg_iov, &i);
++		if (ret < 0)
++			goto out;
++
++		iov_iter_truncate(&i, hdr->dxfer_len);
++		iov_data_len = hdr->dxfer_len;
++#else
+ 		struct iovec *iov;
+ 		int i;
+ 
+@@ -426,6 +442,7 @@
+ 							hdr->dxfer_len);
+ 			iov_data_len = hdr->dxfer_len;
+ 		}
++#endif
+ 
+ 		pfo_cmd.buffer = sg_iov;
+ 		pfo_cmd.bufflen = iov_data_len;
diff --git a/lin_tape.fixlist b/lin_tape.fixlist
index 8d5af8e..526d7ad 100644
--- a/lin_tape.fixlist
+++ b/lin_tape.fixlist
@@ -4,6 +4,17 @@ Fixlist for Linux IBM Tape Device Driver (lin_tape)
 
  Level      Date                   Description
 ---------------------------------------------------------------
+3.0.23 11/03/2017   - Initial support for RHEL 6.9 (min. kernel version 2.6.32-696)
+                    - Support for LTO8
+                    - Fix for reservation conflict when reserve_6 used
+                    - Fix for failover after device rediscovery (introduced at 3.0.20)
+                    - Fix for device name after removal (introduced at 3.0.20)
+                    - Fix for read with resid through join interface
+3.0.21 09/14/2017   - Fix to process sense data from srb combination flags
+                    - Enhancement to not attempt failover when only one path left
+                    - Fix for crash on concurrency (multiple process attempting to use the same device in stress scenario)
+                    - Fix for returning ENXIO instead attempting failover (introduced at 3.0.20)
+                    - Join driver to retry attachment on LUN not serlf configured
 3.0.20 06/09/2017   - Reincorporated join driver (lin_tape_as_sfmp) with new build flag: -with sfmp
                     - Work around for wrong SN reported by Inq. page 80h after failback
                     - Fix for crash when HBA driver removed before lin_tape
@@ -15,7 +26,7 @@ Fixlist for Linux IBM Tape Device Driver (lin_tape)
                     - Initial support for SLES 12 SP2 (min. kernel version 4.4.21-69)
                     - Initial support for RHEL 7.3 (min. kernel version 3.10.0-514)
                     - Initial support for RHEL 7.3 Power LE (min. kernel version 3.10.0-514)
-                    - Initial support for TS1155
+                    - Support for TS4300
 3.0.18 03/08/2017   - Prevent crash from double delete objects on removal during wait scenarios (introduced at 2.2.0)
                     - lin_tape_as_sfmp not supported in this version
                     - Installation for blacklist.conf enhancements
diff --git a/linux-4.10.patch b/linux-4.10.patch
index 0e90019..a6f123e 100644
--- a/linux-4.10.patch
+++ b/linux-4.10.patch
@@ -1,105 +1,81 @@
-diff -ur lin_tape-3.0.8/lin_tape_ioctl_tape.c lin_tape-3.0.8-4.10/lin_tape_ioctl_tape.c
---- lin_tape-3.0.8/lin_tape_ioctl_tape.c	2016-02-23 20:57:52.000000000 +0100
-+++ lin_tape-3.0.8-4.10/lin_tape_ioctl_tape.c	2017-03-25 21:10:22.094478668 +0100
-@@ -6456,7 +6456,11 @@
+diff -ur lin_tape-3.0.23/lin_tape_ioctl_tape.c lin_tape-3.0.23-4.10/lin_tape_ioctl_tape.c
+--- lin_tape-3.0.23/lin_tape_ioctl_tape.c	2018-04-08 00:40:34.811170201 +0200
++++ lin_tape-3.0.23-4.10/lin_tape_ioctl_tape.c	2018-04-08 00:39:08.512197099 +0200
+@@ -6471,7 +6471,7 @@
  
  	tmp_rq = (void*)sdev->request_queue;
  	req->cmd_type = REQ_TYPE_BLOCK_PC;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	req->cmd_flags |= REQ_QUIET;
-+#else
-+	req->cmd_flags |= RQF_QUIET;
-+#endif
- 
- 	if(buf_len) {
- 		mdata = kmalloc(sizeof(struct rq_map_data), GFP_KERNEL);
-diff -ur lin_tape-3.0.8/stmp.c lin_tape-3.0.8-4.10/stmp.c
---- lin_tape-3.0.8/stmp.c	2017-03-25 21:11:10.039325377 +0100
-+++ lin_tape-3.0.8-4.10/stmp.c	2017-03-25 21:10:48.338642620 +0100
-@@ -624,7 +624,11 @@
+ #else
+ 	req->cmd_flags |= RQF_QUIET;
+diff -ur lin_tape-3.0.23/stmp.c lin_tape-3.0.23-4.10/stmp.c
+--- lin_tape-3.0.23/stmp.c	2018-04-08 00:40:34.814503623 +0200
++++ lin_tape-3.0.23-4.10/stmp.c	2018-04-08 00:39:45.023173000 +0200
+@@ -688,7 +688,7 @@
  #else
  	req->cmd_type = REQ_TYPE_BLOCK_PC;
  #endif
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	req->cmd_flags |= REQ_QUIET;
-+#else
-+	req->cmd_flags |= RQF_QUIET;
-+#endif
- 
- 	mdata->null_mapped = 1;
- 
-diff -ur lin_tape-3.0.8/upper.c lin_tape-3.0.8-4.10/upper.c
---- lin_tape-3.0.8/upper.c	2017-03-25 21:11:10.022658187 +0100
-+++ lin_tape-3.0.8-4.10/upper.c	2017-03-25 21:09:10.232174474 +0100
-@@ -89,7 +89,11 @@
+ #else
+ 	req->cmd_flags |= RQF_QUIET;
+diff -ur lin_tape-3.0.23/upper.c lin_tape-3.0.23-4.10/upper.c
+--- lin_tape-3.0.23/upper.c	2018-04-08 00:40:34.814503623 +0200
++++ lin_tape-3.0.23-4.10/upper.c	2018-04-08 00:40:20.187446091 +0200
+@@ -89,7 +89,7 @@
  	pfo_cmd.timeout = timeout;
  	pfo_cmd.retries = retries;
  	pfo_cmd.iov_count = 0;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	pfo_cmd.flags = flags | REQ_QUIET;
-+#else
-+	pfo_cmd.flags = flags | RQF_QUIET;
-+#endif
- 	pfo_cmd.mdata = NULL;
- 	pfo_cmd.raw_sense = sense;
- 	pfo_cmd.sense_len = 0;
-@@ -338,7 +342,11 @@
+ #else
+ 	pfo_cmd.flags = flags | RQF_QUIET;
+@@ -352,7 +352,7 @@
  	pfo_cmd.cmd_len = hdr->cmd_len;
  	pfo_cmd.buffer = NULL;
  	pfo_cmd.bufflen = 0;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	pfo_cmd.flags = REQ_QUIET;
-+#else
-+	pfo_cmd.flags = RQF_QUIET;
-+#endif
- 	pfo_cmd.source = PFO_SOURCE_IOCTL;
- 	pfo_cmd.iov_count = 0;
- 	pfo_cmd.mdata = NULL;
-@@ -453,7 +461,11 @@
+ #else
+ 	pfo_cmd.flags = RQF_QUIET;
+@@ -488,7 +488,7 @@
  	pfo_cmd.cmd_len = hdr->cmd_len;
  	pfo_cmd.buffer = NULL;
  	pfo_cmd.bufflen = 0;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	pfo_cmd.flags = REQ_QUIET;
-+#else
-+	pfo_cmd.flags = RQF_QUIET;
-+#endif
- 	pfo_cmd.source = PFO_SOURCE_IOCTL;
- 	pfo_cmd.iov_count = 0;
- 	pfo_cmd.mdata = NULL;
-@@ -658,7 +670,11 @@
+ #else
+ 	pfo_cmd.flags = RQF_QUIET;
+@@ -691,7 +691,7 @@
  	pfo_cmd.timeout = timeout;
  	pfo_cmd.retries = retries;
  	pfo_cmd.iov_count = 0;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	pfo_cmd.flags = REQ_QUIET;
-+#else
-+	pfo_cmd.flags = RQF_QUIET;
-+#endif
- 	pfo_cmd.mdata = NULL;
- 	pfo_cmd.raw_sense = sense;
- 	pfo_cmd.sense_len = 0;
-@@ -915,7 +931,11 @@
+ #else
+ 	pfo_cmd.flags = RQF_QUIET;
+@@ -952,7 +952,7 @@
  	pfo_cmd.buffer = buffer;
  	pfo_cmd.bufflen = bufflen;
  	pfo_cmd.retries = retries;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	pfo_cmd.flags = REQ_QUIET;
-+#else
-+	pfo_cmd.flags = RQF_QUIET;
-+#endif
- 	pfo_cmd.source = PFO_SOURCE_SG;
- 	pfo_cmd.iov_count = iov_count;
- 	pfo_cmd.mdata = mdata;
-@@ -954,7 +974,11 @@
+ #else
+ 	pfo_cmd.flags = RQF_QUIET;
+@@ -995,7 +995,7 @@
  	pfo_cmd.buffer = buffer;
  	pfo_cmd.bufflen = bufflen;
  	pfo_cmd.retries = retries;
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,73)
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
  	pfo_cmd.flags = REQ_QUIET;
-+#else
-+	pfo_cmd.flags = RQF_QUIET;
-+#endif
- 	pfo_cmd.source = PFO_SOURCE_ST;
- 	pfo_cmd.iov_count = 0;
- 	pfo_cmd.mdata = mdata;
+ #else
+ 	pfo_cmd.flags = RQF_QUIET;
diff --git a/linux-4.13.patch b/linux-4.13.patch
index e8228d3..ae03180 100644
--- a/linux-4.13.patch
+++ b/linux-4.13.patch
@@ -18,7 +18,7 @@
  	}
  
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
 +	scsi_req_init(scsi_req(rq));
 +#else
  	scsi_req_init(rq);
diff --git a/linux-4.9.patch b/linux-4.9.patch
index 78e28b4..d35ff3b 100644
--- a/linux-4.9.patch
+++ b/linux-4.9.patch
@@ -1,24 +1,30 @@
 --- lin_tape-3.0.18/lin_tape_scsi_tape.c~	2017-02-23 19:14:41.000000000 +0100
 +++ lin_tape-3.0.18/lin_tape_scsi_tape.c	2017-05-09 21:28:19.916320963 +0200
-@@ -11838,7 +11838,10 @@
+@@ -11838,10 +11838,9 @@
  
  	down_read(&current->mm->mmap_sem);
  
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,73)
+-	mapped_pages = get_user_pages_unlocked((unsigned long)user_location, number_pages,
+-			                      pages, rw);
+-
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
 +	mapped_pages = get_user_pages((ulong)user_location, number_pages,
 +			                      rw ? FOLL_WRITE : 0, pages, NULL);
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
  	mapped_pages = get_user_pages((ulong)user_location, number_pages,
  			                      rw, 0, pages, NULL);
- #else
 --- lin_tape-3.0.18/stmp.c~	2017-05-09 21:25:12.000000000 +0200
 +++ lin_tape-3.0.18/stmp.c	2017-05-09 21:29:19.121101188 +0200
-@@ -5205,7 +5205,14 @@
+@@ -5205,11 +5205,13 @@
  	if ((pages = kmalloc(max_pages * sizeof(*pages), GFP_KERNEL)) == NULL)
  		return -ENOMEM;
  
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,73)
+-	res = get_user_pages_unlocked(uaddr, nr_pages,
+-			                      pages,
+-								  rw == READ ? FOLL_WRITE : 0); /* don't force */
+-
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
 +	res = get_user_pages_unlocked(
 +		uaddr,
@@ -26,7 +32,6 @@
 +		rw == READ ? FOLL_WRITE : 0,
 +		pages,
 +		NULL);
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
      /* Try to fault in all of the necessary pages */
      /* rw==READ means read from drive, write into memory area */
- 	res = get_user_pages_unlocked(
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lin_tape.git/commitdiff/fda6bd2d880e4d3fe78be9a0eec8f37d322dc093



More information about the pld-cvs-commit mailing list