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,97 +26,6 @@
+@@ -26,109 +26,6 @@
* will build for various releases of Linux. This is how
* we track different versions using ifdef in the source.
*/
-#define AFTER_RH_64 1
-#define AFTER_RH_65 1
-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
-#define BEFORE_RH_70 1
-#define BEFORE_RH_71 1
-#define BEFORE_RH_72 1
-#define BEFORE_RH_72 1
-#endif
-#ifdef KERNELVERSION_3_10_0_327
+-#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
+-#endif
+-#ifdef KERNELVERSION_3_10_0_514
#define AFTER_RH_62 1
#define AFTER_RH_63 1
#define AFTER_RH_64 1
@@ -126,7 +35,6 @@
- #define AFTER_RH_6x 1
#define AFTER_RH_70 1
#define AFTER_RH_71 1
+ #define AFTER_RH_72 1
-#endif
/* Misc defines needed so source is same for all versions of Linux */
if ((sdp->sgdebug > 0) &&
((CHECK_CONDITION == srp->header.masked_status) ||
(COMMAND_TERMINATED == srp->header.masked_status)))
--#ifdef AFTER_RH_71
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
+-#if defined(AFTER_RH_71) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
__scsi_print_sense(sdp->device, "sg_cmd_done", sense, SCSI_SENSE_BUFFERSIZE);
#else
SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
if (cmdstatp->have_sense)
--#ifdef AFTER_RH_70
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
+-#if defined(AFTER_RH_70) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
__scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
#else
@@ -475,7 +475,7 @@
- scode != VOLUME_OVERFLOW &&
SRpnt->cmd[0] != MODE_SENSE &&
SRpnt->cmd[0] != TEST_UNIT_READY) {
--#ifdef AFTER_RH_71
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
+
+-#if defined(AFTER_RH_71) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
__scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
#else
\r
Level Date Description\r
---------------------------------------------------------------\r
+3.0.20 06/09/2017 - Reincorporated join driver (lin_tape_as_sfmp) with new build flag: -with sfmp\r
+ - Work around for wrong SN reported by Inq. page 80h after failback\r
+ - Fix for crash when HBA driver removed before lin_tape\r
+ - Fix for mismatching device SN on failback\r
+ - Fix for busy waits\r
+ - Fix for file systems removals\r
+ - Fix for file systems attributes names\r
+ - Fix for column width at /proc/IBM for SN\r
+ - Initial support for SLES 12 SP2 (min. kernel version 4.4.21-69)\r
+ - Initial support for RHEL 7.3 (min. kernel version 3.10.0-514)\r
+ - Initial support for RHEL 7.3 Power LE (min. kernel version 3.10.0-514)\r
+ - Initial support for TS1155\r
3.0.18 03/08/2017 - Prevent crash from double delete objects on removal during wait scenarios (introduced at 2.2.0)\r
- lin_tape_as_sfmp not supported in this version\r
- Installation for blacklist.conf enhancements\r
+ - Support for TS1155\r
3.0.16 01/06/2017 - Prevent crash introduced at 1.75.0 cleaning buffern and length on WRA during open\r
- Prevent lock/crash introduced at 1.75.0 when device removal during open\r
- Added dualaccesor_cpf for TSLM usage\r
%define pname lin_tape
Summary: IBM Tape SCSI Device Driver for Linux
Name: %{pname}%{_alt_kernel}
-Version: 3.0.18
+Version: 3.0.20
Release: %{rel}%{?_pld_builder:@%{_kernel_ver_str}}
License: GPL v2/LGPL
Group: Base/Kernel
Source0: %{pname}-%{version}.tgz
-# Source0-md5: c82336b8402f1eeadf440e7173895f17
+# Source0-md5: e9780677ade7969498032f10611a3bb6
Source1: %{pname}.fixlist
Patch0: use-module-dir.patch
Patch1: clean-ifdefs.patch
Patch2: linux-4.9.patch
Patch3: linux-4.10.patch
Patch4: linux-4.11.patch
+Patch5: linux-4.12.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
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
install -p %{SOURCE1} .
--- 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 @@
- return DRIVER_ERROR << 24;
-
+ #else
req->cmd_type = REQ_TYPE_BLOCK_PC;
+ #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
req->cmd_flags |= REQ_QUIET;
+#else
status_code = req->errors;
if(buf_len && !use_sg) {
-diff -ur lin_tape-3.0.18/lin_tape_ioctl_tape.c.orig lin_tape-3.0.18-4.11/lin_tape_ioctl_tape.c.orig
---- lin_tape-3.0.18/lin_tape_ioctl_tape.c.orig 2017-02-23 19:14:41.000000000 +0100
-+++ lin_tape-3.0.18-4.11/lin_tape_ioctl_tape.c.orig 2017-05-09 21:45:14.232900215 +0200
-@@ -6465,7 +6465,11 @@
-
- tmp_rq = (void*)sdev->request_queue;
- req->cmd_type = REQ_TYPE_BLOCK_PC;
-+#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.18/lin_tape_tape.h lin_tape-3.0.18-4.11/lin_tape_tape.h
--- lin_tape-3.0.18/lin_tape_tape.h 2017-02-23 19:14:41.000000000 +0100
+++ lin_tape-3.0.18-4.11/lin_tape_tape.h 2017-05-09 21:45:14.236233622 +0200
pfo_cmd->errors = rq->errors;
blk_put_request(rq);
-diff -ur lin_tape-3.0.18/stmp.c lin_tape-3.0.18-4.11/stmp.c
---- lin_tape-3.0.18/stmp.c 2017-05-10 00:36:01.955619894 +0200
-+++ lin_tape-3.0.18-4.11/stmp.c 2017-05-09 21:45:14.236233622 +0200
-@@ -611,7 +611,11 @@
- if (!req)
- return DRIVER_ERROR << 24;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
-+ scsi_req_init(req);
-+#else
- req->cmd_type = REQ_TYPE_BLOCK_PC;
-+#endif
- #if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- req->cmd_flags |= REQ_QUIET;
- #else
--- /dev/null
+--- lin_tape-3.0.20/lin_tape_ioctl_tape.c.orig 2017-08-01 15:02:29.400676838 +0200
++++ lin_tape-3.0.20/lin_tape_ioctl_tape.c 2017-08-01 15:08:53.208605776 +0200
+@@ -6554,7 +6554,11 @@
+ req->sense_len = 0;
+ #endif
+ req->timeout = timeout;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ scsi_req(req)->retries = 0;
++#else
+ req->retries = 0;
++#endif
+
+ blk_execute_rq(req->q, NULL, req, 1);
+
+@@ -6563,7 +6567,11 @@
+ #else
+ *resid = req->resid_len;
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ status_code = scsi_req(req)->result;
++#else
+ status_code = req->errors;
++#endif
+
+ if(buf_len && !use_sg) {
+ buf_ptr = (char*)buffer;
+--- lin_tape-3.0.20/lower.c.orig 2017-08-01 15:09:52.565988839 +0200
++++ lin_tape-3.0.20/lower.c 2017-08-01 15:11:23.877092947 +0200
+@@ -568,7 +568,11 @@
+ rq->sense_len = 0;
+ #endif
+ rq->timeout = pfo_cmd->timeout;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ scsi_req(rq)->retries = pfo_cmd->retries;
++#else
+ rq->retries = pfo_cmd->retries;
++#endif
+ rq->end_io_data = pfo_cmd;
+
+ blk_execute_rq(rq->q, NULL, rq, 1);
+@@ -589,7 +593,11 @@
+ pfo_cmd->resid_len = rq->resid_len;
+ pfo_cmd->sense_len = rq->sense_len;
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ pfo_cmd->errors = scsi_req(rq)->result;
++#else
+ pfo_cmd->errors = rq->errors;
++#endif
+
+ blk_put_request(rq);
+ return pfo_cmd->errors;
--- 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 @@
- /* Try to fault in all of the necessary pages */
- down_read(¤t->mm->mmap_sem);
- /* rw==READ means read from drive, write into memory area */
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+ 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,9,0)
-+ res = get_user_pages(
++ res = get_user_pages_unlocked(
+ uaddr,
+ nr_pages,
+ rw == READ ? FOLL_WRITE : 0,
+ pages,
+ NULL);
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
- res = get_user_pages(
- uaddr,
- nr_pages,
++#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(