From f2d7532eb1e617089af76b427238108a5aa8c013 Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Wed, 18 Nov 2015 03:59:30 +0000
Subject: [PATCH 001/121] scst: Add user space control for suspend/resume
activities
Useful to speed up mass management
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6693 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/README | 13 +++++++++++
scst/README_in-tree | 13 +++++++++++
scst/src/scst_main.c | 10 +++++++++
scst/src/scst_priv.h | 2 ++
scst/src/scst_sysfs.c | 50 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 88 insertions(+)
diff --git a/scst/README b/scst/README
index 978d8f6fb..395be9cc6 100644
--- a/scst/README
+++ b/scst/README
@@ -441,6 +441,19 @@ following entries:
have different IDs and SNs. For instance, VDISK dev handler uses this
ID to generate T10 vendor specific identifier and SN of the devices.
+ - suspend - globally suspends or releases all SCSI activities on all
+ devices. Useful for mass management, like adding or deleting LUNs.
+ Writing to it value v:
+
+ * v > 0 - suspends activities, but waits no more, than v seconds
+
+ * v = 0 - suspends activities, waits indefinitely
+
+ * V < 0 - releases activities.
+
+ Reading from this attribute returns number of previous suspend
+ requests.
+
- threads - allows to read and set number of global SCST I/O threads.
Those threads used with async. dev handlers, for instance, vdisk
BLOCKIO or NULLIO.
diff --git a/scst/README_in-tree b/scst/README_in-tree
index 91d0b6ca6..d1bcc9d59 100644
--- a/scst/README_in-tree
+++ b/scst/README_in-tree
@@ -305,6 +305,19 @@ following entries:
have different IDs and SNs. For instance, VDISK dev handler uses this
ID to generate T10 vendor specific identifier and SN of the devices.
+ - suspend - globally suspends or releases all SCSI activities on all
+ devices. Useful for mass management, like adding or deleting LUNs.
+ Writing to it value v:
+
+ * v > 0 - suspends activities, but waits no more, than v seconds
+
+ * v = 0 - suspends activities, waits indefinitely
+
+ * V < 0 - releases activities.
+
+ Reading from this attribute returns number of previous suspend
+ requests.
+
- threads - allows to read and set number of global SCST I/O threads.
Those threads used with async. dev handlers, for instance, vdisk
BLOCKIO or NULLIO.
diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c
index 85ab18fe1..4bfde9df1 100644
--- a/scst/src/scst_main.c
+++ b/scst/src/scst_main.c
@@ -1057,6 +1057,11 @@ static void __scst_resume_activity(void)
TRACE_ENTRY();
+ if (suspend_count == 0) {
+ PRINT_WARNING("Resume without suspend");
+ goto out;
+ }
+
suspend_count--;
TRACE_MGMT_DBG("suspend_count %d left", suspend_count);
if (suspend_count > 0)
@@ -1117,6 +1122,11 @@ void scst_resume_activity(void)
}
EXPORT_SYMBOL_GPL(scst_resume_activity);
+int scst_get_suspend_count(void)
+{
+ return suspend_count;
+}
+
static int scst_register_device(struct scsi_device *scsidp)
{
int res;
diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h
index 327504f35..6740845c6 100644
--- a/scst/src/scst_priv.h
+++ b/scst/src/scst_priv.h
@@ -729,6 +729,8 @@ void scst_ext_unblock_dev(struct scst_device *dev, bool stpg);
void __scst_ext_blocking_done(struct scst_device *dev);
void scst_ext_blocking_done(struct scst_device *dev);
+int scst_get_suspend_count(void);
+
/*
* Increases global SCST ref counters which prevent from entering into suspended
* activities stage, so protects from any global management operations.
diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c
index 9b7336dd8..62497ecdc 100644
--- a/scst/src/scst_sysfs.c
+++ b/scst/src/scst_sysfs.c
@@ -7056,6 +7056,55 @@ static struct kobj_attribute scst_max_tasklet_cmd_attr =
__ATTR(max_tasklet_cmd, S_IRUGO | S_IWUSR, scst_max_tasklet_cmd_show,
scst_max_tasklet_cmd_store);
+static ssize_t scst_suspend_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ int count;
+
+ TRACE_ENTRY();
+
+ count = sprintf(buf, "%d\n", scst_get_suspend_count());
+
+ TRACE_EXIT();
+ return count;
+}
+
+static ssize_t scst_suspend_store(struct kobject *kobj,
+ struct kobj_attribute *attr, const char *buf, size_t count)
+{
+ int res;
+ long val;
+
+ TRACE_ENTRY();
+
+ res = kstrtol(buf, 0, &val);
+ if (res != 0) {
+ PRINT_ERROR("kstrtoul() for %s failed: %d ", buf, res);
+ goto out;
+ }
+
+ if (val >= 0) {
+ PRINT_INFO("SYSFS: suspending activities (timeout %ld)...", val);
+ res = scst_suspend_activity(val*HZ);
+ if (res == 0)
+ PRINT_INFO("sysfs suspending done");
+ } else {
+ PRINT_INFO("SYSFS: resuming activities");
+ scst_resume_activity();
+ }
+
+ if (res == 0)
+ res = count;
+
+out:
+ TRACE_EXIT_RES(res);
+ return res;
+}
+
+static struct kobj_attribute scst_suspend_attr =
+ __ATTR(suspend, S_IRUGO | S_IWUSR, scst_suspend_show,
+ scst_suspend_store);
+
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static ssize_t scst_main_trace_level_show(struct kobject *kobj,
@@ -7281,6 +7330,7 @@ static struct attribute *scst_sysfs_root_default_attrs[] = {
&scst_threads_attr.attr,
&scst_setup_id_attr.attr,
&scst_max_tasklet_cmd_attr.attr,
+ &scst_suspend_attr.attr,
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
&scst_main_trace_level_attr.attr,
#endif
From 1c9b1f0baad8cc0674e0e0d44bf65fa3b0fa78a8 Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Wed, 18 Nov 2015 04:09:50 +0000
Subject: [PATCH 002/121] scst: Rework Copy Manager's sysfs interface
The old version had management incompatible with scstadmin and had
issues with LUNs management.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6694 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/README | 25 ++--
scst/README_in-tree | 25 ++--
scst/src/scst_copy_mgr.c | 273 +++++++++++++++++----------------------
scst/src/scst_lib.c | 60 ++++++---
scst/src/scst_main.c | 10 +-
scst/src/scst_priv.h | 20 ++-
scst/src/scst_proc.c | 8 +-
scst/src/scst_sysfs.c | 11 +-
8 files changed, 206 insertions(+), 226 deletions(-)
diff --git a/scst/README b/scst/README
index 395be9cc6..8da5009cc 100644
--- a/scst/README
+++ b/scst/README
@@ -1859,34 +1859,25 @@ EXTENDED COPY
~~~~~~~~~~~~~
SCST implements EXTENDED COPY via internal Copy Manager target. This
-target has the following specific attributes in its sysfs:
+target has the following specific attribute in its sysfs:
- allow_not_connected_copy - if not set (default), an initiator can
perform copy only between devices it has direct access to via any
target/session. If set, any initiator can copy between any devices in
the system.
- - mgmt - this attribute allows to control data from which devices can
-be copied using Copy Manager. By default, devices belonging to dev
-handlers with flag auto_cm_assignment_possible set are auto assigned to
-the Copy Manager on the registration. Currently, only vdisk has this
-flag set, so all other devices (pass-through, user space, etc.) should
-be assigned to the Copy Manager manually.
-
-Mgmt attribute supports the following commands:
-
- - add [vname|H:C:I:L] - adds device with name vname or H:C:I:L numbers
-(pass-through) to the Copy Manager.
-
- - del [vname|H:C:I:L] - deletes device with name vname or H:C:I:L numbers
-(pass-through) from the Copy Manager.
-
+The Copy Manager has access only to those devices, for which it has LUNs
+in /sys/kernel/scst_tgt/targets/copy_manager/copy_manager_tgt/luns/.
+Devices from scst_vdisk dev handler added to it automatically upon
+registration, but for other devices you need to manually add LUNs there
+the same way as for any target driver. You can also delete any device at
+any time from the Copy Manager visibility by deleting the corresponding
+LUN from the sysfs. It might be useful during ALUA state switching.
Internally SCST implements EXTENDED COPY as generation of sets of
internal READ(16) and WRITE(16) SCSI commands. Dev handlers don't need
any manual actions to use it.
-
Also SCST provides for dev handlers possibility to remap blocks instead
of copy them, if they support this feature. It allows them to perform
EXTENDED COPY command much faster by just metadata update of their
diff --git a/scst/README_in-tree b/scst/README_in-tree
index d1bcc9d59..669f97f44 100644
--- a/scst/README_in-tree
+++ b/scst/README_in-tree
@@ -1712,34 +1712,25 @@ EXTENDED COPY
~~~~~~~~~~~~~
SCST implements EXTENDED COPY via internal Copy Manager target. This
-target has the following specific attributes in its sysfs:
+target has the following specific attribute in its sysfs:
- allow_not_connected_copy - if not set (default), an initiator can
perform copy only between devices it has direct access to via any
target/session. If set, any initiator can copy between any devices in
the system.
- - mgmt - this attribute allows to control data from which devices can
-be copied using Copy Manager. By default, devices belonging to dev
-handlers with flag auto_cm_assignment_possible set are auto assigned to
-the Copy Manager on the registration. Currently, only vdisk has this
-flag set, so all other devices (pass-through, user space, etc.) should
-be assigned to the Copy Manager manually.
-
-Mgmt attribute supports the following commands:
-
- - add [vname|H:C:I:L] - adds device with name vname or H:C:I:L numbers
-(pass-through) to the Copy Manager.
-
- - del [vname|H:C:I:L] - deletes device with name vname or H:C:I:L numbers
-(pass-through) from the Copy Manager.
-
+The Copy Manager has access only to those devices, for which it has LUNs
+in /sys/kernel/scst_tgt/targets/copy_manager/copy_manager_tgt/luns/.
+Devices from scst_vdisk dev handler added to it automatically upon
+registration, but for other devices you need to manually add LUNs there
+the same way as for any target driver. You can also delete any device at
+any time from the Copy Manager visibility by deleting the corresponding
+LUN from the sysfs. It might be useful during ALUA state switching.
Internally SCST implements EXTENDED COPY as generation of sets of
internal READ(16) and WRITE(16) SCSI commands. Dev handlers don't need
any manual actions to use it.
-
Also SCST provides for dev handlers possibility to remap blocks instead
of copy them, if they support this feature. It allows them to perform
EXTENDED COPY command much faster by just metadata update of their
diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c
index c59233ba8..6fcfbfea7 100644
--- a/scst/src/scst_copy_mgr.c
+++ b/scst/src/scst_copy_mgr.c
@@ -2519,14 +2519,16 @@ static bool scst_cm_is_lun_free(unsigned int lun)
}
/* scst_mutex supposed to be held and activities suspended */
-static int scst_cm_dev_register(struct scst_device *dev)
+static int scst_cm_dev_register(struct scst_device *dev, uint64_t lun)
{
int res, i;
- unsigned int lun;
struct scst_acg_dev *acg_dev;
+ bool add_lun;
TRACE_ENTRY();
+ TRACE_DBG("dev %s, LUN %ld", dev->virt_name, (unsigned long)lun);
+
for (i = 0; i < SESS_TGT_DEV_LIST_HASH_SIZE; i++) {
struct scst_tgt_dev *tgt_dev;
struct list_head *head = &scst_cm_sess->sess_tgt_dev_list[i];
@@ -2541,18 +2543,25 @@ static int scst_cm_dev_register(struct scst_device *dev)
}
}
- while (1) {
- lun = scst_cm_next_lun++;
- if (lun == SCST_MAX_LUN)
- continue;
- if (scst_cm_is_lun_free(lun))
- break;
- };
+ if (lun == SCST_MAX_LUN) {
+ add_lun = true;
+ while (1) {
+ lun = scst_cm_next_lun++;
+ if (lun == SCST_MAX_LUN)
+ continue;
+ if (scst_cm_is_lun_free(lun))
+ break;
+ }
+ } else
+ add_lun = false;
- res = scst_acg_add_lun(scst_cm_tgt->default_acg,
- scst_cm_tgt->tgt_luns_kobj, dev, lun, false, false, &acg_dev);
- if (res != 0)
- goto out_err;
+ if (add_lun) {
+ res = scst_acg_add_lun(scst_cm_tgt->default_acg,
+ scst_cm_tgt->tgt_luns_kobj, dev, lun, SCST_ADD_LUN_CM,
+ &acg_dev);
+ if (res != 0)
+ goto out_err;
+ }
spin_lock_bh(&dev->dev_lock);
scst_block_dev(dev);
@@ -2578,13 +2587,15 @@ out_err:
}
/* scst_mutex supposed to be held and activities suspended */
-static void scst_cm_dev_unregister(struct scst_device *dev)
+static void scst_cm_dev_unregister(struct scst_device *dev, bool del_lun)
{
int i;
struct scst_cm_desig *des, *t;
TRACE_ENTRY();
+ TRACE_DBG("dev %s, del_lun %d", dev->virt_name, del_lun);
+
list_for_each_entry_safe(des, t, &scst_cm_desig_list, cm_desig_list_entry) {
if (des->desig_tgt_dev->dev == dev) {
TRACE_DBG("Deleting des %p", des);
@@ -2593,6 +2604,9 @@ static void scst_cm_dev_unregister(struct scst_device *dev)
}
}
+ if (!del_lun)
+ goto out;
+
for (i = 0; i < SESS_TGT_DEV_LIST_HASH_SIZE; i++) {
struct scst_tgt_dev *tgt_dev;
struct list_head *head = &scst_cm_sess->sess_tgt_dev_list[i];
@@ -2606,6 +2620,7 @@ static void scst_cm_dev_unregister(struct scst_device *dev)
}
}
+out:
TRACE_EXIT();
return;
}
@@ -2620,7 +2635,7 @@ int scst_cm_on_dev_register(struct scst_device *dev)
if (!dev->handler->auto_cm_assignment_possible)
goto out;
- res = scst_cm_dev_register(dev);
+ res = scst_cm_dev_register(dev, SCST_MAX_LUN);
out:
TRACE_EXIT_RES(res);
@@ -2632,12 +2647,87 @@ void scst_cm_on_dev_unregister(struct scst_device *dev)
{
TRACE_ENTRY();
- scst_cm_dev_unregister(dev);
+ scst_cm_dev_unregister(dev, true);
TRACE_EXIT();
return;
}
+/* scst_mutex supposed to be held and activities suspended */
+int scst_cm_on_add_acg(struct scst_acg *acg)
+{
+ int res = 0;
+
+ TRACE_ENTRY();
+
+ if (scst_cm_tgt == NULL)
+ goto out;
+
+ if (acg->tgt != scst_cm_tgt)
+ goto out;
+
+ if (acg != scst_cm_tgt->default_acg) {
+ PRINT_ERROR("Copy Manager does not support security groups");
+ res = -EINVAL;
+ goto out;
+ }
+
+out:
+ TRACE_EXIT_RES(res);
+ return res;
+}
+
+/* scst_mutex supposed to be held and activities suspended */
+void scst_cm_on_del_acg(struct scst_acg *acg)
+{
+ /* Nothing to do */
+}
+
+/* scst_mutex supposed to be held and activities suspended */
+int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, uint64_t lun,
+ unsigned int *flags)
+{
+ int res = 0;
+
+ TRACE_ENTRY();
+
+ if (acg_dev->acg != scst_cm_tgt->default_acg)
+ goto out;
+
+ if (acg_dev->acg_dev_rd_only || acg_dev->dev->dev_rd_only) {
+ PRINT_ERROR("Copy Manager does not support read only devices");
+ res = -EINVAL;
+ goto out;
+ }
+
+ *flags &= ~SCST_ADD_LUN_GEN_UA;
+
+ res = scst_cm_dev_register(acg_dev->dev, lun);
+
+out:
+ TRACE_EXIT_RES(res);
+ return res;
+}
+
+/* scst_mutex supposed to be held and activities suspended */
+bool scst_cm_on_del_lun(struct scst_acg_dev *acg_dev, bool gen_report_luns_changed)
+{
+ bool res = gen_report_luns_changed;
+
+ TRACE_ENTRY();
+
+ if (acg_dev->acg != scst_cm_tgt->default_acg)
+ goto out;
+
+ scst_cm_dev_unregister(acg_dev->dev, false);
+
+ res = false;
+
+out:
+ TRACE_EXIT_RES(res);
+ return res;
+}
+
/* scst_mutex supposed to be locked */
static bool scst_cm_check_access_acg(const char *initiator_name,
const struct scst_device *dev, const struct scst_acg *acg,
@@ -3480,148 +3570,8 @@ static struct kobj_attribute scst_cm_allow_not_conn_copy_attr =
scst_cm_allow_not_conn_copy_show,
scst_cm_allow_not_conn_copy_store);
-static ssize_t scst_cm_mgmt_show(struct kobject *kobj,
- struct kobj_attribute *attr, char *buf)
-{
- static const char help[] =
- "Usage: echo \"add H:C:I:L\" >mgmt\n"
- " echo \"add VNAME\" >mgmt\n"
- " echo \"del H:C:I:L\" >mgmt\n"
- " echo \"del VNAME\" >mgmt\n";
-
- return sprintf(buf, "%s", help);
-}
-
-static int scst_cm_mgmt(struct scst_sysfs_work_item *work)
-{
- int res = 0;
- char *pp, *action, *devstr;
- unsigned int host, channel, id, lun;
- char *buf = work->buf;
- bool vdev;
- struct scst_device *d, *dev = NULL;
-
- TRACE_ENTRY();
-
- TRACE_DBG("buffer %s", buf);
-
- pp = buf;
- action = scst_get_next_lexem(&pp);
- devstr = scst_get_next_lexem(&pp);
- if (*devstr == '\0') {
- PRINT_ERROR("%s", "Device required");
- res = -EINVAL;
- goto out;
- }
-
- if (*scst_get_next_lexem(&pp) != '\0') {
- PRINT_ERROR("%s", "Too many parameters");
- res = -EINVAL;
- goto out_syntax_err;
- }
-
- if (sscanf(devstr, "%u:%u:%u:%u", &host, &channel, &id, &lun) != 4) {
- vdev = true;
- TRACE_DBG("Virt dev %s", devstr);
- } else {
- vdev = false;
- TRACE_DBG("Pass-through dev %d:%d:%d:%d", host, channel, id, lun);
- }
-
- res = scst_suspend_activity(SCST_SUSPEND_TIMEOUT_USER);
- if (res != 0)
- goto out;
-
- res = mutex_lock_interruptible(&scst_mutex);
- if (res != 0)
- goto out_resume;
-
- list_for_each_entry(d, &scst_dev_list, dev_list_entry) {
- if (vdev) {
- if ((d->scsi_dev == NULL) &&
- (strcmp(d->virt_name, devstr) == 0)) {
- dev = d;
- break;
- }
- } else if (d->scsi_dev != NULL &&
- d->scsi_dev->host->host_no == host &&
- d->scsi_dev->channel == channel &&
- d->scsi_dev->id == id &&
- d->scsi_dev->lun == lun) {
- dev = d;
- break;
- }
- }
- if (dev == NULL) {
- PRINT_ERROR("Device %s not found", devstr);
- res = -EINVAL;
- goto out_unlock;
- } else
- TRACE_DBG("Dev %p (%s) found", dev, dev->virt_name);
-
- if (strcasecmp("add", action) == 0)
- res = scst_cm_dev_register(dev);
- else if (strcasecmp("del", action) == 0)
- scst_cm_dev_unregister(dev);
- else {
- PRINT_ERROR("Action %s not understood", action);
- res = -EINVAL;
- }
-
-out_unlock:
- mutex_unlock(&scst_mutex);
-
-out_resume:
- scst_resume_activity();
-
-out:
- TRACE_EXIT_RES(res);
- return res;
-
-out_syntax_err:
- PRINT_ERROR("Syntax error on \"%s\"", buf);
- res = -EINVAL;
- goto out;
-}
-
-static ssize_t scst_cm_mgmt_store(struct kobject *kobj,
- struct kobj_attribute *attr, const char *buffer, size_t size)
-{
- int res;
- struct scst_sysfs_work_item *work;
- char *i_buf;
-
- TRACE_ENTRY();
-
- i_buf = kasprintf(GFP_KERNEL, "%.*s", (int)size, buffer);
- if (i_buf == NULL) {
- PRINT_ERROR("Unable to alloc intermediate buffer with size %zd",
- size+1);
- res = -ENOMEM;
- goto out;
- }
-
- res = scst_alloc_sysfs_work(scst_cm_mgmt, false, &work);
- if (res != 0)
- goto out;
-
- work->buf = i_buf;
-
- res = scst_sysfs_queue_wait_work(work);
- if (res == 0)
- res = size;
-
-out:
- TRACE_EXIT_RES(res);
- return res;
-}
-
-static struct kobj_attribute scst_cm_mgmt_attr =
- __ATTR(mgmt, S_IRUGO|S_IWUSR, scst_cm_mgmt_show, scst_cm_mgmt_store);
-
-static const struct attribute *scst_cm_attrs[] = {
+static const struct attribute *scst_cm_tgtt_attrs[] = {
&scst_cm_allow_not_conn_copy_attr.attr,
- &scst_cm_mgmt_attr.attr,
NULL,
};
@@ -3693,6 +3643,12 @@ static void scst_cm_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd)
return;
}
+static int scst_cm_report_aen(struct scst_aen *aen)
+{
+ /* Nothing to do */
+ return 0;
+}
+
static struct scst_tgt_template scst_cm_tgtt = {
.name = SCST_CM_NAME,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
@@ -3710,9 +3666,10 @@ static struct scst_tgt_template scst_cm_tgtt = {
.release = scst_cm_release,
.xmit_response = scst_cm_xmit_response,
.task_mgmt_fn_done = scst_cm_task_mgmt_fn_done,
+ .report_aen = scst_cm_report_aen,
.get_initiator_port_transport_id = scst_cm_get_initiator_port_transport_id,
#ifndef CONFIG_SCST_PROC
- .tgtt_attrs = scst_cm_attrs,
+ .tgtt_attrs = scst_cm_tgtt_attrs,
#endif
};
diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c
index 8cd269cc7..2a5599948 100644
--- a/scst/src/scst_lib.c
+++ b/scst/src/scst_lib.c
@@ -4373,8 +4373,8 @@ out:
/* The activity supposed to be suspended and scst_mutex held */
int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent,
- struct scst_device *dev, uint64_t lun, int read_only,
- bool gen_scst_report_luns_changed, struct scst_acg_dev **out_acg_dev)
+ struct scst_device *dev, uint64_t lun, unsigned int flags,
+ struct scst_acg_dev **out_acg_dev)
{
int res;
struct scst_acg_dev *acg_dev;
@@ -4395,7 +4395,7 @@ int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent,
res = -ENOMEM;
goto out;
}
- acg_dev->acg_dev_rd_only = read_only;
+ acg_dev->acg_dev_rd_only = ((flags & SCST_ADD_LUN_READ_ONLY) != 0);
if (dev->dev_dif_mode & SCST_DIF_MODE_DEV_STORE) {
/* Devices are allowed to store only CRCs */
acg_dev->acg_dev_dif_guard_format = SCST_DIF_GUARD_FORMAT_CRC;
@@ -4410,6 +4410,12 @@ int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent,
list_add_tail(&acg_dev->acg_dev_list_entry, &acg->acg_dev_list);
list_add_tail(&acg_dev->dev_acg_dev_list_entry, &dev->dev_acg_dev_list);
+ if (!(flags & SCST_ADD_LUN_CM)) {
+ res = scst_cm_on_add_lun(acg_dev, lun, &flags);
+ if (res != 0)
+ goto out_free;
+ }
+
list_for_each_entry(sess, &acg->acg_sess_list, acg_sess_list_entry) {
res = scst_alloc_add_tgt_dev(sess, acg_dev, &tgt_dev);
if (res == -EPERM)
@@ -4423,14 +4429,14 @@ int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent,
res = scst_acg_dev_sysfs_create(acg_dev, parent);
if (res != 0)
- goto out_free;
+ goto out_on_del;
- if (gen_scst_report_luns_changed)
+ if (flags & SCST_ADD_LUN_GEN_UA)
scst_report_luns_changed(acg);
PRINT_INFO("Added device %s to group %s (LUN %lld, "
- "rd_only %d) to target %s", dev->virt_name, acg->acg_name,
- lun, read_only, acg->tgt ? acg->tgt->tgt_name : "?");
+ "flags 0x%x) to target %s", dev->virt_name, acg->acg_name,
+ lun, flags, acg->tgt ? acg->tgt->tgt_name : "?");
if (out_acg_dev != NULL)
*out_acg_dev = acg_dev;
@@ -4439,6 +4445,10 @@ out:
TRACE_EXIT_RES(res);
return res;
+out_on_del:
+ if (!(flags & SCST_ADD_LUN_CM))
+ scst_cm_on_del_lun(acg_dev, false);
+
out_free:
list_for_each_entry_safe(tgt_dev, tt, &tmp_tgt_dev_list,
extra_tgt_dev_list_entry) {
@@ -4450,7 +4460,7 @@ out_free:
/* The activity supposed to be suspended and scst_mutex held */
int scst_acg_del_lun(struct scst_acg *acg, uint64_t lun,
- bool gen_scst_report_luns_changed)
+ bool gen_report_luns_changed)
{
int res = 0;
struct scst_acg_dev *acg_dev = NULL, *a;
@@ -4470,6 +4480,8 @@ int scst_acg_del_lun(struct scst_acg *acg, uint64_t lun,
goto out;
}
+ gen_report_luns_changed = scst_cm_on_del_lun(acg_dev, gen_report_luns_changed);
+
list_for_each_entry_safe(tgt_dev, tt, &acg_dev->dev->dev_tgt_dev_list,
dev_tgt_dev_list_entry) {
if (tgt_dev->acg_dev == acg_dev)
@@ -4478,7 +4490,7 @@ int scst_acg_del_lun(struct scst_acg *acg, uint64_t lun,
scst_del_free_acg_dev(acg_dev, true);
- if (gen_scst_report_luns_changed)
+ if (gen_report_luns_changed)
scst_report_luns_changed(acg);
PRINT_INFO("Removed LUN %lld from group %s (target %s)",
@@ -4490,16 +4502,18 @@ out:
}
/* The activity supposed to be suspended and scst_mutex held */
-struct scst_acg *scst_alloc_add_acg(struct scst_tgt *tgt,
- const char *acg_name, bool tgt_acg)
+int scst_alloc_add_acg(struct scst_tgt *tgt, const char *acg_name,
+ bool tgt_acg, struct scst_acg **out_acg)
{
struct scst_acg *acg;
+ int res;
TRACE_ENTRY();
acg = kzalloc(sizeof(*acg), GFP_KERNEL);
if (acg == NULL) {
PRINT_ERROR("%s", "Allocation of acg failed");
+ res = -ENOMEM;
goto out;
}
@@ -4512,9 +4526,14 @@ struct scst_acg *scst_alloc_add_acg(struct scst_tgt *tgt,
acg->acg_name = kstrdup(acg_name, GFP_KERNEL);
if (acg->acg_name == NULL) {
PRINT_ERROR("%s", "Allocation of acg_name failed");
+ res = -ENOMEM;
goto out_free;
}
+ res = scst_cm_on_add_acg(acg);
+ if (res != 0)
+ goto out_undup;
+
#ifdef CONFIG_SCST_PROC
acg->addr_method = tgt && tgt->tgtt ? tgt->tgtt->preferred_addr_method
: SCST_LUN_ADDR_METHOD_PERIPHERAL;
@@ -4527,30 +4546,35 @@ struct scst_acg *scst_alloc_add_acg(struct scst_tgt *tgt,
acg->addr_method = tgt->tgtt->preferred_addr_method;
if (tgt_acg) {
- int rc;
-
TRACE_DBG("Adding acg '%s' to device '%s' acg_list", acg_name,
tgt->tgt_name);
list_add_tail(&acg->acg_list_entry, &tgt->tgt_acg_list);
acg->tgt_acg = 1;
- rc = scst_acg_sysfs_create(tgt, acg);
- if (rc != 0)
+ res = scst_acg_sysfs_create(tgt, acg);
+ if (res != 0)
goto out_del;
}
kobject_get(&tgt->tgt_kobj);
#endif
+ res = 0;
+
out:
- TRACE_EXIT_HRES(acg);
- return acg;
+ *out_acg = acg;
+
+ TRACE_EXIT_RES(res);
+ return res;
#ifndef CONFIG_SCST_PROC
out_del:
list_del(&acg->acg_list_entry);
#endif
+out_undup:
+ kfree(acg->acg_name);
+
out_free:
kfree(acg);
acg = NULL;
@@ -4573,6 +4597,8 @@ static void scst_del_acg(struct scst_acg *acg)
scst_assert_activity_suspended();
lockdep_assert_held(&scst_mutex);
+ scst_cm_on_del_acg(acg);
+
list_for_each_entry_safe(acg_dev, acg_dev_tmp, &acg->acg_dev_list,
acg_dev_list_entry)
scst_del_acg_dev(acg_dev, true);
diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c
index 4bfde9df1..b5b3851e9 100644
--- a/scst/src/scst_main.c
+++ b/scst/src/scst_main.c
@@ -550,8 +550,8 @@ struct scst_tgt *scst_register_target(struct scst_tgt_template *vtt,
if (rc < 0)
goto out_unlock;
- tgt->default_acg = scst_alloc_add_acg(tgt, tgt->tgt_name, false);
- if (tgt->default_acg == NULL)
+ rc = scst_alloc_add_acg(tgt, tgt->tgt_name, false, &tgt->default_acg);
+ if (rc != 0)
goto out_sysfs_del;
#endif
@@ -2650,11 +2650,9 @@ static int __init init_scst(void)
goto out_sysfs_cleanup;
#ifdef CONFIG_SCST_PROC
- scst_default_acg = scst_alloc_add_acg(NULL, SCST_DEFAULT_ACG_NAME, false);
- if (scst_default_acg == NULL) {
- res = -ENOMEM;
+ res = scst_alloc_add_acg(NULL, SCST_DEFAULT_ACG_NAME, false, &scst_default_acg);
+ if (res != 0)
goto out_destroy_sgv_pool;
- }
#endif
res = scsi_register_interface(&scst_interface);
diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h
index 6740845c6..ae1157d36 100644
--- a/scst/src/scst_priv.h
+++ b/scst/src/scst_priv.h
@@ -347,8 +347,8 @@ int scst_alloc_device(gfp_t gfp_mask, struct scst_device **out_dev);
void scst_free_device(struct scst_device *dev);
bool scst_device_is_exported(struct scst_device *dev);
-struct scst_acg *scst_alloc_add_acg(struct scst_tgt *tgt,
- const char *acg_name, bool tgt_acg);
+int scst_alloc_add_acg(struct scst_tgt *tgt, const char *acg_name,
+ bool tgt_acg, struct scst_acg **out_acg);
int scst_del_free_acg(struct scst_acg *acg, bool close_sessions);
void scst_get_acg(struct scst_acg *acg);
void scst_put_acg(struct scst_acg *acg);
@@ -363,11 +363,14 @@ void scst_sess_free_tgt_devs(struct scst_session *sess);
struct scst_tgt_dev *scst_lookup_tgt_dev(struct scst_session *sess, u64 lun);
void scst_nexus_loss(struct scst_tgt_dev *tgt_dev, bool queue_UA);
+#define SCST_ADD_LUN_READ_ONLY 1
+#define SCST_ADD_LUN_GEN_UA 2
+#define SCST_ADD_LUN_CM 4
int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent,
- struct scst_device *dev, uint64_t lun, int read_only,
- bool gen_scst_report_luns_changed, struct scst_acg_dev **out_acg_dev);
+ struct scst_device *dev, uint64_t lun, unsigned int flags,
+ struct scst_acg_dev **out_acg_dev);
int scst_acg_del_lun(struct scst_acg *acg, uint64_t lun,
- bool gen_scst_report_luns_changed);
+ bool gen_report_luns_changed);
int scst_acg_add_acn(struct scst_acg *acg, const char *name);
#ifdef CONFIG_SCST_PROC
@@ -857,6 +860,13 @@ static inline bool scst_lba1_inside_lba2(int64_t lba1,
int scst_cm_on_dev_register(struct scst_device *dev);
void scst_cm_on_dev_unregister(struct scst_device *dev);
+int scst_cm_on_add_acg(struct scst_acg *acg);
+void scst_cm_on_del_acg(struct scst_acg *acg);
+int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, uint64_t lun,
+ unsigned int *flags);
+bool scst_cm_on_del_lun(struct scst_acg_dev *acg_dev,
+ bool gen_report_luns_changed);
+
int scst_cm_parse_descriptors(struct scst_cmd *cmd);
void scst_cm_free_descriptors(struct scst_cmd *cmd);
diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c
index 1d4dc3c25..26b99c3fe 100644
--- a/scst/src/scst_proc.c
+++ b/scst/src/scst_proc.c
@@ -948,8 +948,8 @@ static int scst_proc_group_add(const char *p, unsigned int addr_method)
}
strlcpy(name, p, len);
- acg = scst_alloc_add_acg(NULL, name, false);
- if (acg == NULL) {
+ res = scst_alloc_add_acg(NULL, name, false, &acg);
+ if (res != 0) {
PRINT_ERROR("scst_alloc_add_acg() (name %s) failed", name);
goto out_free;
}
@@ -969,6 +969,7 @@ out_free_acg:
out_free:
kfree(name);
+ goto out;
out_nomem:
res = -ENOMEM;
@@ -2069,7 +2070,8 @@ static ssize_t scst_proc_groups_devices_write(struct file *file,
}
}
- rc = scst_acg_add_lun(acg, NULL, dev, virt_lun, read_only,
+ rc = scst_acg_add_lun(acg, NULL, dev, virt_lun,
+ read_only ? SCST_ADD_LUN_READ_ONLY : 0,
false, NULL);
if (rc) {
res = rc;
diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c
index 62497ecdc..cc939175e 100644
--- a/scst/src/scst_sysfs.c
+++ b/scst/src/scst_sysfs.c
@@ -1327,6 +1327,7 @@ static int __scst_process_luns_mgmt_store(char *buffer,
case SCST_LUN_ACTION_REPLACE:
{
bool dev_replaced = false;
+ unsigned int flags = 0;
e = scst_get_next_lexem(&pp);
res = kstrtoul(e, 0, &virt_lun);
@@ -1414,9 +1415,13 @@ static int __scst_process_luns_mgmt_store(char *buffer,
}
}
+ if (read_only)
+ flags |= SCST_ADD_LUN_READ_ONLY;
+ if (!dev_replaced)
+ flags |= SCST_ADD_LUN_GEN_UA;
res = scst_acg_add_lun(acg,
tgt_kobj ? tgt->tgt_luns_kobj : acg->luns_kobj,
- dev, virt_lun, read_only, !dev_replaced, NULL);
+ dev, virt_lun, flags, NULL);
if (res != 0)
goto out_unlock;
@@ -2174,8 +2179,8 @@ static int scst_process_ini_group_mgmt_store(char *buffer,
res = -EINVAL;
goto out_unlock;
}
- acg = scst_alloc_add_acg(tgt, p, true);
- if (acg == NULL)
+ res = scst_alloc_add_acg(tgt, p, true, &acg);
+ if (res != 0)
goto out_unlock;
break;
case SCST_INI_GROUP_ACTION_DEL:
From 96bdede086c3cfd2bca0ba0f98e728de01928e92 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 18 Nov 2015 19:36:01 +0000
Subject: [PATCH 003/121] scst: Make it easier to build without DLM support
With this change all that is required to build without DLM support
is to add the following in scst_priv.h:
#undef CONFIG_DLM
#undef CONFIG_DLM_MODULE
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6695 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/Makefile | 5 -----
scst/src/scst_dlm.c | 4 ++++
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/scst/src/Makefile b/scst/src/Makefile
index 51d83b986..ee1501fd0 100644
--- a/scst/src/Makefile
+++ b/scst/src/Makefile
@@ -49,12 +49,7 @@ scst-y += scst_mem.o
scst-y += scst_debug.o
scst-y += scst_pres.o
scst-y += scst_no_dlm.o
-ifdef CONFIG_DLM
scst-y += scst_dlm.o
-endif
-ifdef CONFIG_DLM_MODULE
-scst-y += scst_dlm.o
-endif
scst-y += scst_tg.o
scst-y += scst_event.o
scst-y += scst_copy_mgr.o
diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c
index 0aa1372ea..8e9bdc4f5 100644
--- a/scst/src/scst_dlm.c
+++ b/scst/src/scst_dlm.c
@@ -30,6 +30,8 @@
#include "scst_pres.h"
#include "scst_dlm.h"
+#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)
+
static void scst_pr_dlm_cleanup(struct scst_device *dev);
static void scst_dlm_pre_bast(void *bastarg, int mode);
static void scst_dlm_post_bast(void *bastarg, int mode);
@@ -1493,3 +1495,5 @@ const struct scst_cl_ops scst_dlm_cl_ops = {
.is_not_rsv_holder = scst_dlm_is_not_rsv_holder,
.reserve = scst_dlm_reserve,
};
+
+#endif
From 1c349edbc0a742ecc5bca618be93573c99ff75de Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 18 Nov 2015 22:10:03 +0000
Subject: [PATCH 004/121] scst_pres: Suppress a compiler warning when building
against a kernel with no DLM support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6696 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_pres.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c
index 8ce467d6e..63e9b3f7a 100644
--- a/scst/src/scst_pres.c
+++ b/scst/src/scst_pres.c
@@ -1192,11 +1192,12 @@ int scst_pr_set_cluster_mode(struct scst_device *dev, bool cluster_mode,
dev->virt_name, cluster_mode, res);
dev->cl_ops = &scst_no_dlm_cl_ops;
}
+
+out:
#else
res = cluster_mode ? -ENOTSUPP : 0;
#endif
-out:
return res;
}
EXPORT_SYMBOL(scst_pr_set_cluster_mode);
From 337fe08a72bcc98e3c7924b688dfb2792a9f3521 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 18 Nov 2015 22:10:33 +0000
Subject: [PATCH 005/121] scst_vdisk: Kernel v4.4 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6697 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/dev_handlers/scst_vdisk.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c
index b53a2b312..cb428fe52 100644
--- a/scst/src/dev_handlers/scst_vdisk.c
+++ b/scst/src/dev_handlers/scst_vdisk.c
@@ -1407,6 +1407,7 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
struct inode *inode;
struct file *fd;
struct blk_integrity *bi;
+ const char *bi_profile_name;
TRACE_ENTRY();
@@ -1430,9 +1431,14 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
goto out_no_bi;
}
- TRACE_DBG("BI name %s", bi->name);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
+ bi_profile_name = bi->name;
+#else
+ bi_profile_name = bi->profile->name;
+#endif
+ TRACE_DBG("BI name %s", bi_profile_name);
- if (!strcmp(bi->name, "T10-DIF-TYPE1-CRC")) {
+ if (!strcmp(bi_profile_name, "T10-DIF-TYPE1-CRC")) {
dev->dev_dif_ip_not_supported = 1;
if (virt_dev->dif_type != 1) {
PRINT_ERROR("Integrity type mismatch, %d expected, "
@@ -1441,7 +1447,7 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
res = -EINVAL;
goto out_close;
}
- } else if (!strcmp(bi->name, "T10-DIF-TYPE1-IP")) {
+ } else if (!strcmp(bi_profile_name, "T10-DIF-TYPE1-IP")) {
if (virt_dev->dif_type != 1) {
PRINT_ERROR("Integrity type mismatch, %d expected, "
"but block device has 1 (dev %s)",
@@ -1449,7 +1455,7 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
res = -EINVAL;
goto out_close;
}
- } else if (!strcmp(bi->name, "T10-DIF-TYPE3-CRC")) {
+ } else if (!strcmp(bi_profile_name, "T10-DIF-TYPE3-CRC")) {
dev->dev_dif_ip_not_supported = 1;
if (virt_dev->dif_type != 3) {
PRINT_ERROR("Integrity type mismatch, %d expected, "
@@ -1458,7 +1464,7 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
res = -EINVAL;
goto out_close;
}
- } else if (!strcmp(bi->name, "T10-DIF-TYPE3-IP")) {
+ } else if (!strcmp(bi_profile_name, "T10-DIF-TYPE3-IP")) {
if (virt_dev->dif_type != 3) {
PRINT_ERROR("Integrity type mismatch, %d expected, "
"but block device has 3 (dev %s)",
@@ -1468,7 +1474,7 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev)
}
} else {
PRINT_ERROR("Unable to understand integrity name %s"
- "(dev %s)", bi->name, dev->virt_name);
+ "(dev %s)", bi_profile_name, dev->virt_name);
res = -EINVAL;
goto out_close;
}
From 098f6bd1c5da8f19397be2263956a3cc796afc7d Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 18 Nov 2015 22:10:54 +0000
Subject: [PATCH 006/121] ib_srpt: Kernel v4.4 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6698 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
srpt/src/ib_srpt.c | 64 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 60 insertions(+), 4 deletions(-)
diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c
index 8a8e09389..6015f29fa 100644
--- a/srpt/src/ib_srpt.c
+++ b/srpt/src/ib_srpt.c
@@ -3356,7 +3356,11 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
struct srpt_send_ioctx *ioctx,
scst_data_direction dir)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
struct ib_send_wr wr;
+#else
+ struct ib_rdma_wr wr;
+#endif
struct ib_send_wr *bad_wr;
struct rdma_iu *riu;
int i;
@@ -3377,6 +3381,7 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
memset(&wr, 0, sizeof(wr));
for (i = 0; i < n_rdma; ++i, ++riu) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
if (dir == SCST_DATA_READ) {
wr.opcode = IB_WR_RDMA_WRITE;
wr.wr_id = encode_wr_id(i == n_rdma - 1 ?
@@ -3401,6 +3406,32 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
wr.send_flags = IB_SEND_SIGNALED;
ret = ib_post_send(ch->qp, &wr, &bad_wr);
+#else
+ if (dir == SCST_DATA_READ) {
+ wr.wr.opcode = IB_WR_RDMA_WRITE;
+ wr.wr.wr_id = encode_wr_id(i == n_rdma - 1 ?
+ SRPT_RDMA_WRITE_LAST :
+ SRPT_RDMA_MID,
+ ioctx->ioctx.index);
+ } else {
+ wr.wr.opcode = IB_WR_RDMA_READ;
+ wr.wr.wr_id = encode_wr_id(i == n_rdma - 1 ?
+ SRPT_RDMA_READ_LAST :
+ SRPT_RDMA_MID,
+ ioctx->ioctx.index);
+ }
+ wr.wr.next = NULL;
+ wr.remote_addr = riu->raddr;
+ wr.rkey = riu->rkey;
+ wr.wr.num_sge = riu->sge_cnt;
+ wr.wr.sg_list = riu->sge;
+
+ /* only get completion event for the last rdma wr */
+ if (i == (n_rdma - 1) && dir == SCST_DATA_WRITE)
+ wr.wr.send_flags = IB_SEND_SIGNALED;
+
+ ret = ib_post_send(ch->qp, &wr.wr, &bad_wr);
+#endif
if (ret)
break;
}
@@ -3409,6 +3440,7 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
pr_err("%s: ib_post_send() returned %d for %d/%d\n", __func__,
ret, i, n_rdma);
if (ret && i > 0) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
wr.num_sge = 0;
wr.wr_id = encode_wr_id(SRPT_RDMA_ABORT, ioctx->ioctx.index);
wr.send_flags = IB_SEND_SIGNALED;
@@ -3420,13 +3452,34 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
ioctx->ioctx.index);
msleep(1000);
}
+#else
+ wr.wr.num_sge = 0;
+ wr.wr.wr_id = encode_wr_id(SRPT_RDMA_ABORT, ioctx->ioctx.index);
+ wr.wr.send_flags = IB_SEND_SIGNALED;
+ pr_info("Trying to abort failed RDMA transfer [%d]\n",
+ ioctx->ioctx.index);
+ while (ch->state == CH_LIVE &&
+ ib_post_send(ch->qp, &wr.wr, &bad_wr) != 0) {
+ pr_info("Trying to abort failed RDMA transfer [%d]\n",
+ ioctx->ioctx.index);
+ msleep(1000);
+ }
+#endif
pr_info("Waiting until RDMA abort finished [%d]\n",
ioctx->ioctx.index);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
while (ch->state < CH_DISCONNECTED && !ioctx->rdma_aborted) {
pr_info("Waiting until RDMA abort finished [%d]\n",
ioctx->ioctx.index);
msleep(1000);
}
+#else
+ while (ch->state < CH_DISCONNECTED && !ioctx->rdma_aborted) {
+ pr_info("Waiting until RDMA abort finished [%d]\n",
+ ioctx->ioctx.index);
+ msleep(1000);
+ }
+#endif
pr_info("%s[%d]: done\n", __func__, __LINE__);
}
@@ -4480,13 +4533,16 @@ static int __init srpt_init_module(void)
if (rdma_cm_port) {
struct sockaddr_in addr;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) || \
- defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 6
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) && \
+ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6)
+ rdma_cm_id = rdma_create_id(srpt_rdma_cm_handler, NULL,
+ RDMA_PS_TCP);
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
rdma_cm_id = rdma_create_id(srpt_rdma_cm_handler, NULL,
RDMA_PS_TCP, IB_QPT_RC);
#else
- rdma_cm_id = rdma_create_id(srpt_rdma_cm_handler, NULL,
- RDMA_PS_TCP);
+ rdma_cm_id = rdma_create_id(&init_net, srpt_rdma_cm_handler,
+ NULL, RDMA_PS_TCP, IB_QPT_RC);
#endif
if (IS_ERR(rdma_cm_id)) {
rdma_cm_id = NULL;
From 87347442fdca8b599f2a69fa9f9219a0edea985c Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 18 Nov 2015 22:11:37 +0000
Subject: [PATCH 007/121] isert-scst: Port to Linux kernel v4.4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6699 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
iscsi-scst/kernel/isert-scst/iser.h | 4 +++
iscsi-scst/kernel/isert-scst/iser_buf.c | 19 +++++++++++++++
iscsi-scst/kernel/isert-scst/iser_pdu.c | 23 ++++++++++++++++++
iscsi-scst/kernel/isert-scst/iser_rdma.c | 31 +++++++++++++++++++++---
4 files changed, 73 insertions(+), 4 deletions(-)
diff --git a/iscsi-scst/kernel/isert-scst/iser.h b/iscsi-scst/kernel/isert-scst/iser.h
index 90fa056a2..eeb8040fc 100644
--- a/iscsi-scst/kernel/isert-scst/iser.h
+++ b/iscsi-scst/kernel/isert-scst/iser.h
@@ -98,7 +98,11 @@ struct isert_wr {
struct ib_sge *sge_list;
union {
struct ib_recv_wr recv_wr;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
struct ib_send_wr send_wr;
+#else
+ struct ib_rdma_wr send_wr;
+#endif
};
} ____cacheline_aligned;
diff --git a/iscsi-scst/kernel/isert-scst/iser_buf.c b/iscsi-scst/kernel/isert-scst/iser_buf.c
index daa78c72a..7bd34c9a2 100644
--- a/iscsi-scst/kernel/isert-scst/iser_buf.c
+++ b/iscsi-scst/kernel/isert-scst/iser_buf.c
@@ -238,9 +238,14 @@ int isert_wr_init(struct isert_wr *wr,
buff_offset = -EFAULT;
goto out;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
wr->send_wr.wr.rdma.remote_addr = pdu->rem_write_va +
buff_offset;
wr->send_wr.wr.rdma.rkey = pdu->rem_write_stag;
+#else
+ wr->send_wr.remote_addr = pdu->rem_write_va + buff_offset;
+ wr->send_wr.rkey = pdu->rem_write_stag;
+#endif
break;
case ISER_WR_RDMA_WRITE:
send_wr_op = IB_WR_RDMA_WRITE;
@@ -250,9 +255,14 @@ int isert_wr_init(struct isert_wr *wr,
buff_offset = -EFAULT;
goto out;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
wr->send_wr.wr.rdma.remote_addr = pdu->rem_read_va +
buff_offset;
wr->send_wr.wr.rdma.rkey = pdu->rem_read_stag;
+#else
+ wr->send_wr.remote_addr = pdu->rem_read_va + buff_offset;
+ wr->send_wr.rkey = pdu->rem_read_stag;
+#endif
break;
default:
BUG();
@@ -278,12 +288,21 @@ int isert_wr_init(struct isert_wr *wr,
wr->recv_wr.sg_list = wr->sge_list;
wr->recv_wr.num_sge = sg_cnt;
} else {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
wr->send_wr.next = NULL;
wr->send_wr.wr_id = _ptr_to_u64(wr);
wr->send_wr.sg_list = wr->sge_list;
wr->send_wr.num_sge = sg_cnt;
wr->send_wr.opcode = send_wr_op;
wr->send_wr.send_flags = send_flags;
+#else
+ wr->send_wr.wr.next = NULL;
+ wr->send_wr.wr.wr_id = _ptr_to_u64(wr);
+ wr->send_wr.wr.sg_list = wr->sge_list;
+ wr->send_wr.wr.num_sge = sg_cnt;
+ wr->send_wr.wr.opcode = send_wr_op;
+ wr->send_wr.wr.send_flags = send_flags;
+#endif
}
out:
diff --git a/iscsi-scst/kernel/isert-scst/iser_pdu.c b/iscsi-scst/kernel/isert-scst/iser_pdu.c
index 0c6e81b32..cf30db258 100644
--- a/iscsi-scst/kernel/isert-scst/iser_pdu.c
+++ b/iscsi-scst/kernel/isert-scst/iser_pdu.c
@@ -214,7 +214,11 @@ out:
static inline void isert_link_send_wrs(struct isert_wr *from_wr,
struct isert_wr *to_wr)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
from_wr->send_wr.next = &to_wr->send_wr;
+#else
+ from_wr->send_wr.wr.next = &to_wr->send_wr.wr;
+#endif
}
static inline void isert_link_send_pdu_wrs(struct isert_cmnd *from_pdu,
@@ -222,7 +226,11 @@ static inline void isert_link_send_pdu_wrs(struct isert_cmnd *from_pdu,
int wr_cnt)
{
isert_link_send_wrs(&from_pdu->wr[wr_cnt - 1], &to_pdu->wr[0]);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
to_pdu->wr[0].send_wr.next = NULL;
+#else
+ to_pdu->wr[0].send_wr.wr.next = NULL;
+#endif
}
int isert_prepare_rdma(struct isert_cmnd *isert_pdu,
@@ -281,8 +289,14 @@ int isert_prepare_rdma(struct isert_cmnd *isert_pdu,
isert_link_send_wrs(&isert_pdu->wr[i - 1], &isert_pdu->wr[i]);
if (op == ISER_WR_RDMA_READ) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
isert_pdu->wr[wr_cnt - 1].send_wr.send_flags = IB_SEND_SIGNALED;
isert_pdu->wr[wr_cnt - 1].send_wr.next = NULL;
+#else
+ isert_pdu->wr[wr_cnt - 1].send_wr.wr.send_flags =
+ IB_SEND_SIGNALED;
+ isert_pdu->wr[wr_cnt - 1].send_wr.wr.next = NULL;
+#endif
}
out:
@@ -574,7 +588,11 @@ int isert_pdu_send(struct isert_connection *isert_conn,
#endif
wr = &tx_pdu->wr[0];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
wr->send_wr.num_sge = isert_pdu_prepare_send(isert_conn, tx_pdu);
+#else
+ wr->send_wr.wr.num_sge = isert_pdu_prepare_send(isert_conn, tx_pdu);
+#endif
err = isert_post_send(isert_conn, wr, 1);
if (unlikely(err)) {
@@ -595,8 +613,13 @@ int isert_pdu_post_rdma_write(struct isert_connection *isert_conn,
TRACE_ENTRY();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
isert_rsp->wr[0].send_wr.num_sge = isert_pdu_prepare_send(isert_conn,
isert_rsp);
+#else
+ isert_rsp->wr[0].send_wr.wr.num_sge = isert_pdu_prepare_send(isert_conn,
+ isert_rsp);
+#endif
isert_link_send_pdu_wrs(isert_cmd, isert_rsp, wr_cnt);
err = isert_post_send(isert_conn, &isert_cmd->wr[0], wr_cnt + 1);
if (unlikely(err)) {
diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c
index 8fd02ab4a..08050a221 100644
--- a/iscsi-scst/kernel/isert-scst/iser_rdma.c
+++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c
@@ -103,7 +103,11 @@ int isert_post_send(struct isert_connection *isert_conn,
struct isert_wr *first_wr,
int num_wr)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
struct ib_send_wr *first_ib_wr = &first_wr->send_wr;
+#else
+ struct ib_send_wr *first_ib_wr = &first_wr->send_wr.wr;
+#endif
struct ib_send_wr *bad_wr;
int num_posted;
int err;
@@ -131,9 +135,19 @@ void isert_post_drain(struct isert_connection *isert_conn)
isert_wr_set_fields(&isert_conn->drain_wr, isert_conn, NULL);
isert_conn->drain_wr.wr_op = ISER_WR_SEND;
- isert_conn->drain_wr.send_wr.wr_id = _ptr_to_u64(&isert_conn->drain_wr);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
+ isert_conn->drain_wr.send_wr.wr_id =
+ _ptr_to_u64(&isert_conn->drain_wr);
isert_conn->drain_wr.send_wr.opcode = IB_WR_SEND;
- err = ib_post_send(isert_conn->qp, &isert_conn->drain_wr.send_wr, &bad_wr);
+ err = ib_post_send(isert_conn->qp,
+ &isert_conn->drain_wr.send_wr, &bad_wr);
+#else
+ isert_conn->drain_wr.send_wr.wr.wr_id =
+ _ptr_to_u64(&isert_conn->drain_wr);
+ isert_conn->drain_wr.send_wr.wr.opcode = IB_WR_SEND;
+ err = ib_post_send(isert_conn->qp,
+ &isert_conn->drain_wr.send_wr.wr, &bad_wr);
+#endif
if (unlikely(err)) {
pr_err("Failed to post drain wr, err:%d\n", err);
/*
@@ -601,6 +615,7 @@ static void isert_handle_wc_error(struct ib_wc *wc)
struct isert_buf *isert_buf = wr->buf;
struct isert_device *isert_dev = wr->isert_dev;
struct ib_device *ib_dev = isert_dev->ib_dev;
+ u32 num_sge;
TRACE_ENTRY();
@@ -615,7 +630,12 @@ static void isert_handle_wc_error(struct ib_wc *wc)
switch (wr->wr_op) {
case ISER_WR_SEND:
- if (unlikely(wr->send_wr.num_sge == 0)) /* Drain WR */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
+ num_sge = wr->send_wr.num_sge;
+#else
+ num_sge = wr->send_wr.wr.num_sge;
+#endif
+ if (unlikely(num_sge == 0)) /* Drain WR */
isert_sched_conn_drained(isert_conn);
else
isert_pdu_err(&isert_pdu->iscsi);
@@ -1648,9 +1668,12 @@ struct isert_portal *isert_portal_create(void)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) && \
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 <= 5)
cm_id = rdma_create_id(isert_cm_evt_handler, portal, RDMA_PS_TCP);
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
cm_id = rdma_create_id(isert_cm_evt_handler, portal, RDMA_PS_TCP,
IB_QPT_RC);
+#else
+ cm_id = rdma_create_id(&init_net, isert_cm_evt_handler, portal,
+ RDMA_PS_TCP, IB_QPT_RC);
#endif
if (unlikely(IS_ERR(cm_id))) {
err = PTR_ERR(cm_id);
From 032f4fd73305260c179a222d571d4a35a580f0f5 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 18 Nov 2015 22:44:29 +0000
Subject: [PATCH 008/121] scst: Do not build cluster PR support if
CONFIG_SCST_NO_DLM has been set
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6700 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/Makefile | 3 ++-
scst/src/scst_dlm.c | 3 ++-
scst/src/scst_pres.c | 6 ++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/scst/src/Makefile b/scst/src/Makefile
index ee1501fd0..7e1209cc9 100644
--- a/scst/src/Makefile
+++ b/scst/src/Makefile
@@ -155,7 +155,8 @@ INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst
enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi)
EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \
- -Wno-unused-parameter -Wno-missing-field-initializers)
+ -Wno-unused-parameter -Wno-missing-field-initializers) \
+ $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM)
#EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING
diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c
index 8e9bdc4f5..342941d96 100644
--- a/scst/src/scst_dlm.c
+++ b/scst/src/scst_dlm.c
@@ -30,7 +30,8 @@
#include "scst_pres.h"
#include "scst_dlm.h"
-#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)
+#if (defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)) && \
+ !defined(CONFIG_SCST_NO_DLM)
static void scst_pr_dlm_cleanup(struct scst_device *dev);
static void scst_dlm_pre_bast(void *bastarg, int mode);
diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c
index 63e9b3f7a..dff5620e1 100644
--- a/scst/src/scst_pres.c
+++ b/scst/src/scst_pres.c
@@ -1173,10 +1173,12 @@ void scst_pr_cleanup(struct scst_device *dev)
int scst_pr_set_cluster_mode(struct scst_device *dev, bool cluster_mode,
const char *cl_dev_id)
{
- bool cluster_mode_enabled = false;
int res = 0;
-#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE)
+#if defined(CONFIG_DLM) || defined(CONFIG_DLM_MODULE) && \
+ !defined(CONFIG_SCST_NO_DLM)
+ bool cluster_mode_enabled = false;
+
cluster_mode_enabled = dev->cl_ops == &scst_dlm_cl_ops;
if (cluster_mode_enabled == cluster_mode)
From f5d73fa9ed4b9e785095128b7ad90443f03b1742 Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Thu, 19 Nov 2015 05:20:43 +0000
Subject: [PATCH 009/121] scst: fix explicit ALUA disabled DIF type 2 handling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6701 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/dev_handlers/scst_vdisk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c
index cb428fe52..8a471ce1f 100644
--- a/scst/src/dev_handlers/scst_vdisk.c
+++ b/scst/src/dev_handlers/scst_vdisk.c
@@ -2796,6 +2796,7 @@ static const struct scst_opcode_descriptor *vdisk_opcode_descriptors_type2[] = {
&scst_op_descr_write_verify32,
&scst_op_descr_write_same32,
SCST_OPCODE_DESCRIPTORS
+ &scst_op_descr_stpg, /* must be last, see vdisk_get_supported_opcodes()! */
};
static const struct scst_opcode_descriptor *vcdrom_opcode_descriptors[] = {
From c2283e427155f1255cf771d52f6a497b7076f11f Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Thu, 19 Nov 2015 16:53:18 +0000
Subject: [PATCH 010/121] scst_sysfs: Introduce scst_parse_add_repl_param()
This makes the __scst_process_luns_mgmt_store() source code slightly
easier to read.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6703 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_sysfs.c | 142 ++++++++++++++++++++++++------------------
1 file changed, 82 insertions(+), 60 deletions(-)
diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c
index cc939175e..11f0f2663 100644
--- a/scst/src/scst_sysfs.c
+++ b/scst/src/scst_sysfs.c
@@ -1253,11 +1253,88 @@ static void scst_tgt_release(struct kobject *kobj)
return;
}
+static int scst_parse_add_repl_param(struct scst_acg *acg,
+ struct scst_device *dev, char *pp,
+ unsigned long *virt_lun,
+ bool *read_only)
+{
+ int res;
+ char *e;
+
+ *read_only = false;
+ e = scst_get_next_lexem(&pp);
+ res = kstrtoul(e, 0, virt_lun);
+ if (res != 0) {
+ PRINT_ERROR("Valid LUN required for dev %s (res %d)",
+ dev->virt_name, res);
+ goto out;
+ } else if (*virt_lun > SCST_MAX_LUN) {
+ PRINT_ERROR("Too big LUN %ld (max %d)", *virt_lun, SCST_MAX_LUN);
+ res = -EINVAL;
+ goto out;
+ }
+
+ while (1) {
+ unsigned long val;
+ char *param = scst_get_next_token_str(&pp);
+ char *p, *pp;
+
+ if (param == NULL)
+ break;
+
+ p = scst_get_next_lexem(¶m);
+ if (*p == '\0') {
+ PRINT_ERROR("Syntax error at %s (device %s)", param,
+ dev->virt_name);
+ res = -EINVAL;
+ goto out;
+ }
+
+ pp = scst_get_next_lexem(¶m);
+ if (*pp == '\0') {
+ PRINT_ERROR("Parameter %s value missed for device %s",
+ p, dev->virt_name);
+ res = -EINVAL;
+ goto out;
+ }
+
+ if (scst_get_next_lexem(¶m)[0] != '\0') {
+ PRINT_ERROR("Too many parameter %s values (device %s)",
+ p, dev->virt_name);
+ res = -EINVAL;
+ goto out;
+ }
+
+ res = kstrtoul(pp, 0, &val);
+ if (res != 0) {
+ PRINT_ERROR("kstrtoul() for %s failed: %d "
+ "(device %s)", pp, res, dev->virt_name);
+ goto out;
+ }
+
+ if (strcasecmp("read_only", p) == 0) {
+ *read_only = !!val;
+ TRACE_DBG("READ ONLY %d", *read_only);
+ } else {
+ PRINT_ERROR("Unknown parameter %s (device %s)", p,
+ dev->virt_name);
+ res = -EINVAL;
+ goto out;
+ }
+ }
+
+ res = 0;
+
+out:
+ return res;
+}
+
static int __scst_process_luns_mgmt_store(char *buffer,
struct scst_tgt *tgt, struct scst_acg *acg, bool tgt_kobj)
{
- int res, read_only = 0, action;
- char *p, *pp, *e;
+ int res, action;
+ bool read_only;
+ char *p, *pp;
unsigned long virt_lun;
struct scst_acg_dev *acg_dev = NULL, *acg_dev_tmp;
struct scst_device *d, *dev = NULL;
@@ -1329,65 +1406,10 @@ static int __scst_process_luns_mgmt_store(char *buffer,
bool dev_replaced = false;
unsigned int flags = 0;
- e = scst_get_next_lexem(&pp);
- res = kstrtoul(e, 0, &virt_lun);
- if (res != 0) {
- PRINT_ERROR("Valid LUN required for dev %s (res %d)", p, res);
+ res = scst_parse_add_repl_param(acg, dev, pp, &virt_lun,
+ &read_only);
+ if (res != 0)
goto out_unlock;
- } else if (virt_lun > SCST_MAX_LUN) {
- PRINT_ERROR("Too big LUN %ld (max %d)", virt_lun, SCST_MAX_LUN);
- res = -EINVAL;
- goto out_unlock;
- }
-
- while (1) {
- unsigned long val;
- char *param = scst_get_next_token_str(&pp);
- char *pp;
-
- if (param == NULL)
- break;
-
- p = scst_get_next_lexem(¶m);
- if (*p == '\0') {
- PRINT_ERROR("Syntax error at %s (device %s)",
- param, dev->virt_name);
- res = -EINVAL;
- goto out_unlock;
- }
-
- pp = scst_get_next_lexem(¶m);
- if (*pp == '\0') {
- PRINT_ERROR("Parameter %s value missed for device %s",
- p, dev->virt_name);
- res = -EINVAL;
- goto out_unlock;
- }
-
- if (scst_get_next_lexem(¶m)[0] != '\0') {
- PRINT_ERROR("Too many parameter's %s values (device %s)",
- p, dev->virt_name);
- res = -EINVAL;
- goto out_unlock;
- }
-
- res = kstrtoul(pp, 0, &val);
- if (res != 0) {
- PRINT_ERROR("kstrtoul() for %s failed: %d "
- "(device %s)", pp, res, dev->virt_name);
- goto out_unlock;
- }
-
- if (!strcasecmp("read_only", p)) {
- read_only = val;
- TRACE_DBG("READ ONLY %d", read_only);
- } else {
- PRINT_ERROR("Unknown parameter %s (device %s)",
- p, dev->virt_name);
- res = -EINVAL;
- goto out_unlock;
- }
- }
acg_dev = NULL;
list_for_each_entry(acg_dev_tmp, &acg->acg_dev_list,
From a2d86af17f886980dab2f5bbe2dd22d1cfde3272 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Thu, 19 Nov 2015 17:30:24 +0000
Subject: [PATCH 011/121] scripts/run-regression-tests: Also test no-DLM build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6704 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scripts/run-regression-tests | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests
index 745e3d19d..031e73117 100755
--- a/scripts/run-regression-tests
+++ b/scripts/run-regression-tests
@@ -141,6 +141,26 @@ function compile_scst_unpatched {
)
}
+# Compile the unpatched SCST source code without DLM.
+function compile_scst_no_dlm {
+ local scst="$PWD"
+ local outputfile="${outputdir}/compilation-output-no-dlm.txt"
+ local workingdirectory="${outputdir}/scst-no-dlm"
+
+ echo "Testing whether the SCST tree compiles fine without DLM support ..."
+ (
+ if mkdir -p "${workingdirectory}" \
+ && cd "${workingdirectory}" \
+ && duplicate_scst_source_tree "${scst}" \
+ && CONFIG_SCST_NO_DLM=y compile_scst &> "${outputfile}"
+ then
+ echo "OK"
+ else
+ echo "FAILED"
+ fi
+ )
+}
+
# Test out-of-tree compilation agains the kernel header files in
# /lib/modules/$(uname -r)/build.
function compile_scst_patched {
@@ -558,6 +578,7 @@ fi
test_scst_tree_patches || exit $?
if [ "${run_local_compilation}" = "true" ]; then
compile_scst_unpatched || exit $?
+ compile_scst_no_dlm || exit $?
compile_scst_patched 2release || exit $?
compile_scst_patched 2perf || exit $?
compile_scst_patched enable_proc || exit $?
From c07e1ef0efafa0df0084653b22319c8be7f45596 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Thu, 19 Nov 2015 17:31:02 +0000
Subject: [PATCH 012/121] scst: Fix procfs build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6705 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/include/scst.h | 2 ++
scst/src/dev_handlers/scst_user.c | 15 +++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/scst/include/scst.h b/scst/include/scst.h
index a88f6cce1..34314dc78 100644
--- a/scst/include/scst.h
+++ b/scst/include/scst.h
@@ -5675,8 +5675,10 @@ struct scst_ext_copy_seg_descr {
int tgt_descr_offs;
};
+#ifndef CONFIG_SCST_PROC
void scst_ext_copy_remap_done(struct scst_cmd *ec_cmd,
struct scst_ext_copy_data_descr *dds, int dds_cnt);
int scst_ext_copy_get_cur_seg_data_len(struct scst_cmd *ec_cmd);
+#endif
#endif /* __SCST_H */
diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c
index caf33d27c..a319a9382 100644
--- a/scst/src/dev_handlers/scst_user.c
+++ b/scst/src/dev_handlers/scst_user.c
@@ -955,6 +955,7 @@ static int dev_user_exec(struct scst_cmd *cmd)
return res;
}
+#ifndef CONFIG_SCST_PROC
static void dev_user_ext_copy_remap(struct scst_cmd *cmd,
struct scst_ext_copy_seg_descr *seg)
{
@@ -985,6 +986,7 @@ static void dev_user_ext_copy_remap(struct scst_cmd *cmd,
TRACE_EXIT();
return;
}
+#endif
static void dev_user_free_sgv(struct scst_user_cmd *ucmd)
{
@@ -1485,6 +1487,7 @@ static int dev_user_process_reply_on_cache_free(struct scst_user_cmd *ucmd)
return res;
}
+#ifndef CONFIG_SCST_PROC
static int dev_user_process_reply_ext_copy_remap(struct scst_user_cmd *ucmd,
struct scst_user_reply_cmd *reply)
{
@@ -1628,6 +1631,7 @@ out_status:
scst_set_cmd_error_status(cmd, rreply->status);
goto out_done;
}
+#endif
static int dev_user_process_ws_reply(struct scst_user_cmd *ucmd,
struct scst_user_scsi_cmd_reply_exec *ereply)
@@ -1950,9 +1954,11 @@ unlock_process:
res = dev_user_process_reply_on_cache_free(ucmd);
break;
+#ifndef CONFIG_SCST_PROC
case UCMD_STATE_EXT_COPY_REMAPPING:
res = dev_user_process_reply_ext_copy_remap(ucmd, reply);
break;
+#endif
case UCMD_STATE_TM_RECEIVED_EXECING:
case UCMD_STATE_TM_DONE_EXECING:
@@ -2677,7 +2683,11 @@ static void dev_user_unjam_cmd(struct scst_user_cmd *ucmd, int busy,
SCST_CONTEXT_THREAD);
else {
sBUG_ON(state != UCMD_STATE_EXT_COPY_REMAPPING);
+#ifndef CONFIG_SCST_PROC
scst_ext_copy_remap_done(ucmd->cmd, NULL, 0);
+#else
+ sBUG();
+#endif
}
/* !! At this point cmd and ucmd can be already freed !! */
@@ -3217,10 +3227,11 @@ static void dev_user_setup_functions(struct scst_user_dev *dev)
dev->devtype.dev_alloc_data_buf = dev_user_alloc_data_buf;
dev->devtype.dev_done = NULL;
+ dev->devtype.ext_copy_remap = NULL;
+#ifndef CONFIG_SCST_PROC
if (dev->ext_copy_remap_supported)
dev->devtype.ext_copy_remap = dev_user_ext_copy_remap;
- else
- dev->devtype.ext_copy_remap = NULL;
+#endif
if (dev->parse_type != SCST_USER_PARSE_CALL) {
switch (dev->devtype.type) {
From 82564f30ab34c8630190aabed810f1e6e5e171c3 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Thu, 19 Nov 2015 17:48:18 +0000
Subject: [PATCH 013/121] scst: More procfs build fixes. See also r6694.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6706 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_priv.h | 21 +++++++++++++++++++++
scst/src/scst_proc.c | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h
index ae1157d36..f0f87d8e3 100644
--- a/scst/src/scst_priv.h
+++ b/scst/src/scst_priv.h
@@ -893,6 +893,27 @@ void scst_cm_exit(void);
static inline int scst_cm_on_dev_register(struct scst_device *dev) { return 0; }
static inline void scst_cm_on_dev_unregister(struct scst_device *dev) {}
+static inline int scst_cm_on_add_acg(struct scst_acg *acg)
+{
+ return 0;
+}
+
+static inline void scst_cm_on_del_acg(struct scst_acg *acg)
+{
+}
+
+static inline int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, uint64_t lun,
+ unsigned int *flags)
+{
+ return 0;
+}
+
+static inline bool scst_cm_on_del_lun(struct scst_acg_dev *acg_dev,
+ bool gen_report_luns_changed)
+{
+ return gen_report_luns_changed;
+}
+
static inline int scst_cm_parse_descriptors(struct scst_cmd *cmd)
{
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_invalid_opcode));
diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c
index 26b99c3fe..0ade29717 100644
--- a/scst/src/scst_proc.c
+++ b/scst/src/scst_proc.c
@@ -2072,7 +2072,7 @@ static ssize_t scst_proc_groups_devices_write(struct file *file,
rc = scst_acg_add_lun(acg, NULL, dev, virt_lun,
read_only ? SCST_ADD_LUN_READ_ONLY : 0,
- false, NULL);
+ NULL);
if (rc) {
res = rc;
goto out_free_up;
From ce479e0b01724cded1f4f6139ce068372411e31d Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 20 Nov 2015 21:47:57 +0000
Subject: [PATCH 014/121] scst_local: Linux kernel v4.4 build fix
Signed-off-by: Sebastian Herbszt
[ bvanassche: Merged the two #if-statements into a single #if-statement ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6707 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst_local/scst_local.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c
index cf1cd8e31..45fe9c111 100644
--- a/scst_local/scst_local.c
+++ b/scst_local/scst_local.c
@@ -1619,7 +1619,8 @@ static struct scsi_host_template scst_lcl_ini_driver_template = {
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25))
.eh_target_reset_handler = scst_local_target_reset,
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) && \
+ LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
.use_blk_tags = true,
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) || \
From 2f455b29d1e26c073b35d232d8d129db5bbd96a5 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 20 Nov 2015 23:23:48 +0000
Subject: [PATCH 015/121] /etc/init.d/scst: Suppress rmmod error messages
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6708 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/init.d/scst | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scstadmin/init.d/scst b/scstadmin/init.d/scst
index ba5ce6f19..1366920f0 100755
--- a/scstadmin/init.d/scst
+++ b/scstadmin/init.d/scst
@@ -171,7 +171,9 @@ unload_kmod() {
m="$1"
t="$2"
i=0
- while [ -e "/sys/module/$m/refcnt" ] && ! rmmod "$m" && [ $i -lt "$t" ]; do
+ while [ -e "/sys/module/$m/refcnt" ] && ! rmmod "$m" 2>/dev/null &&
+ [ $i -lt "$t" ]
+ do
sleep 1
i=$((i+1))
done
From 0f3bcea86db1ca6b5d7b1064bbbd129984a80f02 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sat, 21 Nov 2015 00:19:04 +0000
Subject: [PATCH 016/121] scstadmin: Improve copy manager support
Add support for saving and restoring copy manager attributes.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6709 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/init.d/scst | 1 +
scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm | 5 ++---
scstadmin/scstadmin.sysfs/scstadmin | 10 +++++++++-
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/scstadmin/init.d/scst b/scstadmin/init.d/scst
index 1366920f0..5e609c26f 100755
--- a/scstadmin/init.d/scst
+++ b/scstadmin/init.d/scst
@@ -149,6 +149,7 @@ parse_scst_conf() {
case "$d" in
iscsi) echo iscsi_scst;;
qla2x00t) echo qla2x00tgt;;
+ copy_manager) ;;
*) echo "$d";;
esac
done | sort -u` \
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
index 4aa497f98..3e5ab798b 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
@@ -5,7 +5,7 @@ package SCST::SCST;
# Author: Mark R. Buechler
# License: GPLv2
# Copyright (c) 2005-2011 Mark R. Buechler
-# Copyright (c) 2011 Bart Van Assche .
+# Copyright (c) 2011-2015 Bart Van Assche .
use 5.005;
use Fcntl ':mode';
@@ -550,8 +550,7 @@ sub drivers {
if (opendir($dHandle, $_path)) {
foreach my $driver (readdir($dHandle)) {
- next if ($driver eq '.' || $driver eq '..' ||
- $driver eq 'copy_manager');
+ next if ($driver eq '.' || $driver eq '..');
if (-d make_path(SCST_TARGETS_DIR(), $driver)) {
push @drivers, $driver;
diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin
index 60d609717..39c478e4b 100755
--- a/scstadmin/scstadmin.sysfs/scstadmin
+++ b/scstadmin/scstadmin.sysfs/scstadmin
@@ -7,7 +7,7 @@ $Version = 'SCST Configurator v3.1.0-pre1';
# Author: Mark R. Buechler
# License: GPLv2
# Copyright (c) 2005-2011 Mark R. Buechler
-# Copyright (C) 2011 Bart Van Assche
+# Copyright (C) 2011-2015 Bart Van Assche
sub usage
{
@@ -1462,6 +1462,9 @@ sub writeConfiguration {
my $t_lun_buff;
foreach my $lun (sort numerically keys %{$luns}) {
+ # Do not save copy_manager LUN definitions.
+ next if ($driver eq 'copy_manager');
+
my $lun_dev = $$luns{$lun};
$t_lun_buff .= "\t\tLUN $lun $lun_dev";
@@ -2614,6 +2617,11 @@ sub applyLunAssignments {
my $c_luns;
my $changes = 0;
+ # Do not restore copy_manager LUN definitions.
+ if ($driver eq 'copy_manager') {
+ return 0;
+ }
+
if (defined($group)) {
$c_luns = $CURRENT{'assign'}->{$driver}->{$target}->{'GROUP'}->{$group}->{'LUN'};
} else {
From d6b116c46d9d75df7027ce41052c8c5ffc4b1977 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sun, 22 Nov 2015 19:49:18 +0000
Subject: [PATCH 017/121] qla2x00t: Fix a few typos
Signed-off-by: Sebastian Herbszt
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6710 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
qla2x00t/qla_isr.c | 6 +++---
qla2x00t/qla_os.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/qla2x00t/qla_isr.c b/qla2x00t/qla_isr.c
index 5f2923dbe..83714a603 100644
--- a/qla2x00t/qla_isr.c
+++ b/qla2x00t/qla_isr.c
@@ -261,7 +261,7 @@ qla2x00_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
/* Read all mbox registers? */
mboxes = (1 << ha->mbx_count) - 1;
if (!ha->mcp)
- ql_dbg(ql_dbg_async, vha, 0x5001, "MBX pointer ERRROR.\n");
+ ql_dbg(ql_dbg_async, vha, 0x5001, "MBX pointer ERROR.\n");
else
mboxes = ha->mcp->in_mb;
@@ -1516,7 +1516,7 @@ qla2x00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len,
struct scsi_dif_tuple {
__be16 guard; /* Checksum */
- __be16 app_tag; /* APPL identifer */
+ __be16 app_tag; /* APPL identifier */
__be32 ref_tag; /* Target LBA or indirect LBA */
};
@@ -2073,7 +2073,7 @@ qla24xx_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
/* Read all mbox registers? */
mboxes = (1 << ha->mbx_count) - 1;
if (!ha->mcp)
- ql_dbg(ql_dbg_async, vha, 0x504e, "MBX pointer ERRROR.\n");
+ ql_dbg(ql_dbg_async, vha, 0x504e, "MBX pointer ERROR.\n");
else
mboxes = ha->mcp->in_mb;
diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c
index bbaad3885..eb40c5405 100644
--- a/qla2x00t/qla_os.c
+++ b/qla2x00t/qla_os.c
@@ -1171,7 +1171,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type,
if (qla2x00_eh_wait_for_pending_commands(vha, cmd->device->id,
cmd->device->lun, type) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x800d,
- "wait for peding cmds failed for cmd=%p.\n", cmd);
+ "wait for pending cmds failed for cmd=%p.\n", cmd);
goto eh_reset_failed;
}
@@ -1274,7 +1274,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
eh_bus_reset_done:
ql_log(ql_log_warn, vha, 0x802b,
"BUS RESET %s nexus=%ld:%d:%d.\n",
- (ret == FAILED) ? "FAILED" : "SUCCEDED", vha->host_no, id, lun);
+ (ret == FAILED) ? "FAILED" : "SUCCEEDED", vha->host_no, id, lun);
return ret;
}
From 3047ca75fdda0ba80410265ba0c0b7b4246a46f1 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sun, 22 Nov 2015 20:03:29 +0000
Subject: [PATCH 018/121] mpt: Include header file mptbase.h without path
Allow include path modification with LSI_INC_DIR.
Signed-off-by: Sebastian Herbszt
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6711 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
mpt/mpt_scst.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mpt/mpt_scst.h b/mpt/mpt_scst.h
index 98d11fcab..51dd1c55f 100644
--- a/mpt/mpt_scst.h
+++ b/mpt/mpt_scst.h
@@ -37,7 +37,7 @@
#define MPT_STM_64_BIT_DMA 1
#endif
-#include "../drivers/message/fusion/mptbase.h"
+#include "mptbase.h"
#ifndef MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED
#define MPI_IOCLOGINFO_FC_LINK_ALREADY_INITIALIZED 0x24000002
From 949aa31053721ec04e7570862e80f269e980ac2c Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Mon, 23 Nov 2015 23:04:57 +0000
Subject: [PATCH 019/121] scstadmin: Improve copy manager support further
Also restore pass-through LUNs
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6712 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
.../scst-0.9.10/lib/SCST/SCST.pm | 6 ++-
.../scst-0.9.10/t/01-start-scst.t | 2 +
scstadmin/scstadmin.sysfs/scstadmin | 43 ++++++++++++++-----
3 files changed, 40 insertions(+), 11 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
index 3e5ab798b..2eb5055e2 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
@@ -3930,7 +3930,11 @@ sub handlerAttributes {
}
}
- next if ($attribute eq SCST_MGMT_IO);
+ if ($attribute eq SCST_MGMT_IO) {
+ $attributes{$attribute}->{'static'} = TRUE;
+ $attributes{$attribute}->{'value'} = $value;
+ next;
+ }
if (!(($mode & S_IRUSR) >> 6)) {
$attributes{$attribute}->{'static'} = FALSE;
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t
index b30abe46a..703756e0f 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t
@@ -9,6 +9,8 @@ BEGIN {
if ($> == 0) {
ok(system("killall iscsi-scstd >/dev/null 2>&1; " .
+ "modprobe -r scst_cdrom; " .
+ "modprobe -r scst_disk; " .
"modprobe -r scst_local; " .
"modprobe -r isert-scst; " .
"modprobe -r iscsi-scst; " .
diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin
index 39c478e4b..81fec91cc 100755
--- a/scstadmin/scstadmin.sysfs/scstadmin
+++ b/scstadmin/scstadmin.sysfs/scstadmin
@@ -1334,6 +1334,25 @@ sub serializeNkAttr {
return $result;
}
+# Return TRUE if and only if $1 is an SCST pass-through device.
+sub isPassthroughDev {
+ my $dev = shift;
+ my $pt = FALSE;
+
+ foreach my $handler (keys %{$CURRENT{'handler'}}) {
+ my ($ha, $errorString) = $SCST->handlerAttributes($handler);
+ next if ($ha->{'mgmt'} !~ 'echo "add_device H:C:I:L"');
+ my @devs = @{$CURRENT{'handler'}->{$handler}};
+ for my $i (0 .. $#devs) {
+ if ($dev eq @devs[$i]) {
+ $pt = TRUE;
+ last;
+ }
+ }
+ last if $pt;
+ }
+}
+
# Returns 0 upon success and 1 upon error.
sub writeConfiguration {
my $nonkey = shift;
@@ -1462,11 +1481,14 @@ sub writeConfiguration {
my $t_lun_buff;
foreach my $lun (sort numerically keys %{$luns}) {
- # Do not save copy_manager LUN definitions.
- next if ($driver eq 'copy_manager');
-
my $lun_dev = $$luns{$lun};
+ # Do not save copy_manager LUN definitions
+ # for LUNs associated with an SCST device
+ # handler.
+ next if ($driver eq 'copy_manager' &&
+ isPassthroughDev($lun_dev));
+
$t_lun_buff .= "\t\tLUN $lun $lun_dev";
my ($attributes, $errorString) = $SCST->lunAttributes($driver, $target, $lun);
@@ -1895,7 +1917,7 @@ sub checkConfiguration {
}
}
- if (!defined($$tgt{'LUN'}->{'0'})) {
+ if ($driver ne 'copy_manager' && !defined($$tgt{'LUN'}->{'0'})) {
print "\t-> WARNING: No LUN 0 defined for driver/target '$driver/$target'. ".
"Many initiators require a LUN 0 to be defined.\n\n";
$warnings++;
@@ -2107,7 +2129,7 @@ sub applyConfigAssignments {
if ($deletions) {
removeLun($driver, $target, $lun);
$changes++;
- } else {
+ } elsif ($driver ne 'copy_manager') {
print "\t-> Device '$device' at LUN '$lun' is not in configuration ".
"for driver/target '$driver/$target'. ".
"Use -force to remove it.\n";
@@ -2617,11 +2639,6 @@ sub applyLunAssignments {
my $c_luns;
my $changes = 0;
- # Do not restore copy_manager LUN definitions.
- if ($driver eq 'copy_manager') {
- return 0;
- }
-
if (defined($group)) {
$c_luns = $CURRENT{'assign'}->{$driver}->{$target}->{'GROUP'}->{$group}->{'LUN'};
} else {
@@ -4888,6 +4905,12 @@ sub addLun {
my $attributes = shift;
my $group = shift;
+ # Do not complain about existing copy manager LUNs.
+ if ($driver eq 'copy_manager' &&
+ $SCST->lunExists($driver, $target, $lun, $group)) {
+ return FALSE;
+ }
+
if (defined($group)) {
print "\t-> Adding device '$device' at LUN $lun to driver/target/group ".
"'$driver/$target/$group': ";
From 3353e47e28783cdf6b14f5917945d0f471517826 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Mon, 23 Nov 2015 23:05:24 +0000
Subject: [PATCH 020/121] scstadmin: Make regression test 6 pass
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6713 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
.../scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t | 4 +++-
.../scstadmin.sysfs/scst-0.9.10/t/after-restore.conf | 10 +++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
index 883f020f3..ada3d17a4 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
@@ -41,13 +41,15 @@ sub testRestoreConfig {
"scstadmin-test-06-$$-1");
my $tmpfilename2 = File::Spec->catfile(File::Spec->tmpdir(),
"scstadmin-test-06-$$-2");
+ my $diff = File::Spec->catfile(File::Spec->tmpdir(),
+ "scstadmin-test-06-$$-diff");
system("$scstadmin -clear_config -force -noprompt -no_lip >/dev/null");
system("$scstadmin -cont_on_err -no_lip -config $to_be_restored" .
" >/dev/null");
system("$scstadmin -write_config $tmpfilename1 >/dev/null");
system("awk 'BEGIN {t = 0 } /^# Automatically generated by SCST Configurator v/ { \$0 = \"# Automatically generated by SCST Configurator v...\" } /^TARGET_DRIVER.*{\$/ { if (\$0 != \"TARGET_DRIVER scst_local {\") t = 1 } /^}\$/ { if (t == 1) t = 2 } /^\$/ { if (t == 2) { t = 3 } } /^./ { if (t == 3) { t = 0 } } { if (t == 0) print }' <$tmpfilename1 >$tmpfilename2");
- my $compare_result = system("diff -u $tmpfilename2 $expected");
+ my $compare_result = system("diff -u $tmpfilename2 $expected >$diff");
ok($compare_result, 0);
if ($compare_result == 0) {
unlink($tmpfilename2);
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/after-restore.conf b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/after-restore.conf
index f0c5264f2..8f5291be5 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/after-restore.conf
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/after-restore.conf
@@ -14,6 +14,11 @@ TARGET_DRIVER scst_local {
LUN 0 disk01
LUN 1 disk01
+ GROUP group_without_luns_with_attrs {
+
+ addr_method FLAT
+ }
+
GROUP initiator_group {
LUN 0 disk01
LUN 1 disk01 {
@@ -27,11 +32,6 @@ TARGET_DRIVER scst_local {
INITIATOR ini3
}
-
- GROUP group_without_luns_with_attrs {
-
- addr_method FLAT
- }
}
}
From c86027404ad18575cfc921363accf3c5dd2627ad Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 25 Nov 2015 17:28:02 +0000
Subject: [PATCH 021/121] usr/fileio: Build fix for Ubuntu 15.10
Ubuntu 15.10 includes Linux kernel 4.2 but does not define
SERVICE_ACTION_IN_16 in the glibc header. Hence
provide a definition in scst_const.h.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6714 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/include/scst_const.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h
index b0a2fc51b..cd213cbee 100644
--- a/scst/include/scst_const.h
+++ b/scst/include/scst_const.h
@@ -466,10 +466,10 @@ static inline int scst_sense_response_code(const uint8_t *sense)
#endif
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+#ifndef GENERATING_UPSTREAM_PATCH
/*
* See also patch "scsi: rename SERVICE_ACTION_IN_16 to SERVICE_ACTION_IN_16"
- * (commit eb846d9f147455e4e5e1863bfb5e31974bb69b7c).
+ * (commit eb846d9f147455e4e5e1863bfb5e31974bb69b7c; kernel 3.19.0).
*/
#ifndef SERVICE_ACTION_IN_16
#define SERVICE_ACTION_IN_16 0x9e
From 3136f99a8692566212f2cc8ee419c63c5358e561 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sat, 28 Nov 2015 04:39:57 +0000
Subject: [PATCH 022/121] scst-const.h: Follow-up for r6714
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6715 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/include/scst_const.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h
index cd213cbee..caa54728c 100644
--- a/scst/include/scst_const.h
+++ b/scst/include/scst_const.h
@@ -466,7 +466,7 @@ static inline int scst_sense_response_code(const uint8_t *sense)
#endif
#endif
-#ifndef GENERATING_UPSTREAM_PATCH
+#if !defined(__KERNEL__) || LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
/*
* See also patch "scsi: rename SERVICE_ACTION_IN_16 to SERVICE_ACTION_IN_16"
* (commit eb846d9f147455e4e5e1863bfb5e31974bb69b7c; kernel 3.19.0).
From edfd19ee7e2698d252333e915161f2d7087ae061 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 2 Dec 2015 16:57:45 +0000
Subject: [PATCH 023/121] scst: Rename the PR-sync document to avoid filenames
with spaces in the SCST tree
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6716 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
...the-DLM-as-a-Distributed-In-Memory-Database.pdf} | Bin
1 file changed, 0 insertions(+), 0 deletions(-)
rename doc/{Using the DLM as a Distributed In-Memory Database.pdf => Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf} (100%)
diff --git a/doc/Using the DLM as a Distributed In-Memory Database.pdf b/doc/Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf
similarity index 100%
rename from doc/Using the DLM as a Distributed In-Memory Database.pdf
rename to doc/Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf
From ad812fedb644eb942f0c8481ba2e8596655a0875 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 2 Dec 2015 22:59:33 +0000
Subject: [PATCH 024/121] scstadmin: Ensure that -no_lip takes effect for all
SCST configuration commands
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6717 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/scstadmin | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin
index 81fec91cc..4a5b4556c 100755
--- a/scstadmin/scstadmin.sysfs/scstadmin
+++ b/scstadmin/scstadmin.sysfs/scstadmin
@@ -1051,7 +1051,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeVirtualTarget($driver, $removeTarget);
- $rc = issueLip($driver) if (!$rc);
+ $rc = issueLip($driver) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1071,7 +1071,7 @@ sub main {
defined($addInitiator) && do {
print "\n-> Making requested changes.\n";
$rc = addInitiator($driver, $target, $group, $addInitiator);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1079,7 +1079,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeInitiator($driver, $target, $group, $removeInitiator);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1087,7 +1087,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = moveInitiator($driver, $target, $group, $moveInitiator, $to);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1095,14 +1095,14 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = clearInitiators($driver, $target, $group);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
defined($addLun) && do {
print "\n-> Making requested changes.\n";
$rc = addLun($driver, $target, $device, $addLun, $attributes, $group);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1110,7 +1110,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeLun($driver, $target, $removeLun, $group);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1118,7 +1118,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = replaceLun($driver, $target, $group, $replaceLun, $device, $attributes);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1126,7 +1126,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = clearLuns($driver, $target, $group);
- $rc = issueLip($driver, $target) if (!$rc);
+ $rc = issueLip($driver, $target) if (!$rc && !$noLip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1145,7 +1145,7 @@ sub main {
};
defined($issueLip) && do {
print "\n-> Making requested changes.\n";
- $rc = issueLip($driver, $issueLip, TRUE);
+ $rc = issueLip($driver, $issueLip, TRUE) if (!$noLip);
print "\t-> Done.\n";
last SWITCH;
};
From d31e5bd373ccde66a9916d748b6f88e6d79de421 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 4 Dec 2015 00:31:40 +0000
Subject: [PATCH 025/121] nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6718 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
nightly/conf/nightly.conf | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf
index 6b79841c8..67abb86e4 100644
--- a/nightly/conf/nightly.conf
+++ b/nightly/conf/nightly.conf
@@ -8,13 +8,13 @@ ABT_KERNELS=" \
4.1.13-nc \
4.0.9-nc \
3.19.7-nc \
-3.18.19-nc \
+3.18.24-nc \
3.17.8-nc \
3.16.7-nc \
3.15.10-nc \
3.14.57-nc \
3.13.11-nc \
-3.12.44-nc \
+3.12.51-nc \
3.11.10-nc \
3.10.93-nc \
3.9.11-nc \
@@ -24,7 +24,7 @@ ABT_KERNELS=" \
3.5.7-nc \
3.4.108-nc \
3.3.8-nc \
-3.2.67-nc \
+3.2.74-nc \
3.1.10-nc \
3.0.101-nc \
2.6.39.4-nc \
From 0b8cb936d3896db94fc9496d085b55998381045b Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Tue, 8 Dec 2015 03:44:51 +0000
Subject: [PATCH 026/121] docs: fix (extra)clean brocken by r6716
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6720 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
doc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/Makefile b/doc/Makefile
index c1b59b8cc..de55e58a8 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -36,9 +36,9 @@ rtf: $(RTFS)
$(COMMAND)rtf $(<)
clean:
- mv "Using the DLM as a Distributed In-Memory Database.pdf" "Using the DLM as a Distributed In-Memory Database.pdf_"
+ -mv "Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf" "Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf_"
rm -f *.txt *.html *.tex *.dvi *.ps *.pdf *.info *.lyx *.rtf
- mv "Using the DLM as a Distributed In-Memory Database.pdf_" "Using the DLM as a Distributed In-Memory Database.pdf"
+ -mv "Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf_" "Using-the-DLM-as-a-Distributed-In-Memory-Database.pdf"
extraclean: clean
rm -f *.orig *.rej
From a195aee513403737a261c13c1658449e66060d60 Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Tue, 8 Dec 2015 03:51:01 +0000
Subject: [PATCH 027/121] Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6721 d57e44dd-8a1f-0410-8b47-8ef2f437770f
From 82d831be8080bc36c3567378d67ec34608571e28 Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Tue, 8 Dec 2015 04:16:01 +0000
Subject: [PATCH 028/121] scst_event: fix forgotten corner case module_put
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6723 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_event.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c
index 3b36b8e50..c7af51a4f 100644
--- a/scst/src/scst_event.c
+++ b/scst/src/scst_event.c
@@ -866,7 +866,7 @@ static int scst_event_create_priv(struct file *file)
PRINT_ERROR("Unable to allocate priv (size %zd)",
sizeof(*priv));
res = -ENOMEM;
- goto out;
+ goto out_put;
}
TRACE_MEM("priv %p allocated", priv);
@@ -891,6 +891,10 @@ static int scst_event_create_priv(struct file *file)
out:
TRACE_EXIT_RES(res);
return res;
+
+out_put:
+ module_put(THIS_MODULE);
+ goto out;
}
static long scst_event_ioctl(struct file *file, unsigned int cmd,
From 08b774f6439fa115d511a15dc9dd9313943b6301 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 9 Dec 2015 19:18:01 +0000
Subject: [PATCH 029/121] scst_main: Fix wait_event() call in
scst_unregister_target()
Avoid that the following kernel warning gets triggered:
WARNING: CPU: 3 PID: 12967 at kernel/sched/core.c:7287 __might_sleep+0x7a/0x90()
do not call blocking ops when !TASK_RUNNING; state=2 set at [] prepare_to_wait_event+0x5e/0xf0
CPU: 3 PID: 12967 Comm: scst_uid Tainted: G O 4.0.0-debug+ #1
Call Trace:
[] dump_stack+0x4c/0x65
[] warn_slowpath_common+0x80/0xc0
[] warn_slowpath_fmt+0x41/0x50
[] __might_sleep+0x7a/0x90
[] mutex_lock_nested+0x2a/0x4d0
[] test_sess_list+0x1a/0x40 [scst]
[] scst_unregister_target+0x26e/0x380 [scst]
[] __scst_local_remove_target+0xc6/0x160 [scst_local]
[] scst_local_sysfs_del_target+0xbc/0x1b0 [scst_local]
[] scst_process_tgtt_mgmt_store+0x205/0x300 [scst]
[] scst_tgtt_mgmt_store_work_fn+0x14/0x20 [scst]
[] scst_process_sysfs_works+0xbd/0x1f0 [scst]
[] sysfs_work_thread_fn+0xbd/0x310 [scst]
[] kthread+0xf3/0x110
[] ret_from_fork+0x58/0x90
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6724 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_main.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c
index b5b3851e9..512d0bae1 100644
--- a/scst/src/scst_main.c
+++ b/scst/src/scst_main.c
@@ -593,16 +593,6 @@ out_free_tgt:
}
EXPORT_SYMBOL(scst_register_target);
-static inline int test_sess_list(struct scst_tgt *tgt)
-{
- int res;
-
- mutex_lock(&scst_mutex);
- res = list_empty(&tgt->sysfs_sess_list);
- mutex_unlock(&scst_mutex);
- return res;
-}
-
/**
* scst_unregister_target() - unregister target.
*
@@ -655,8 +645,15 @@ again:
mutex_unlock(&scst_mutex);
#endif
+ /*
+ * Testing tgt->sysfs_sess_list below without holding scst_mutex
+ * is safe because 'tgt' won't disappear until scst_free_tgt() is
+ * called below and because the mutex_lock(&scst_mutex) call below
+ * waits until scst_free_session() has finished accessing the 'tgt'
+ * object.
+ */
TRACE_DBG("%s", "Waiting for sessions shutdown");
- wait_event(tgt->unreg_waitQ, test_sess_list(tgt));
+ wait_event(tgt->unreg_waitQ, list_empty(&tgt->sysfs_sess_list));
TRACE_DBG("%s", "wait_event() returned");
scst_suspend_activity(SCST_SUSPEND_TIMEOUT_UNLIMITED);
From d13b730d6df72a5362db43e299ecd636d79a0ce2 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 01:38:46 +0000
Subject: [PATCH 030/121] ib_srpt: Improve robustness of "make clean"
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6725 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
srpt/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/srpt/Makefile b/srpt/Makefile
index 370b308b2..e224c4be4 100644
--- a/srpt/Makefile
+++ b/srpt/Makefile
@@ -139,8 +139,8 @@ src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \
clean:
rm -rf conftest/pre_cflags conftest/kcflags
- for d in conftest/* src; do \
- $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/$$d clean; \
+ for d in conftest/* src; do \
+ [ -d "$$d" ] && $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/$$d clean; \
done
rm -f src/$(MODULE_SYMVERS) src/Module.markers src/modules.order
From 8aae2413b38dbbb4da1f816a673748551ca21c34 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 01:39:46 +0000
Subject: [PATCH 031/121] ib_srpt: Convert srpt_ch_list_empty() to RCU
This patch avoids that the following warning is reported when
unloading the ib_srpt kernel module:
WARNING: CPU: 9 PID: 33739 at kernel/sched/core.c:7533 __might_sleep+0x82/0x90()
do not call blocking ops when !TASK_RUNNING; state=2 set at [] prepare_to_wait_event+0x63/0x110
Call Trace:
[] dump_stack+0x4f/0x74
[] warn_slowpath_common+0x8b/0xd0
[] warn_slowpath_fmt+0x41/0x70
[] __might_sleep+0x82/0x90
[] mutex_lock_nested+0x33/0x380
[] srpt_ch_list_empty+0x2b/0x80 [ib_srpt]
[] srpt_release_sport+0xcc/0x2a0 [ib_srpt]
[] srpt_release+0x35/0x80 [ib_srpt]
[] scst_unregister_target+0x70/0x380 [scst]
[] srpt_remove_one+0xb1/0x150 [ib_srpt]
[] ib_unregister_client+0xe5/0x190 [ib_core]
[] srpt_cleanup_module+0x21/0x2f [ib_srpt]
[] SyS_delete_module+0x17b/0x1c0
[] entry_SYSCALL_64_fastpath+0x12/0x6f
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6726 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
srpt/src/ib_srpt.c | 21 ++++++++++++---------
srpt/src/ib_srpt.h | 2 ++
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c
index 6015f29fa..2d2895335 100644
--- a/srpt/src/ib_srpt.c
+++ b/srpt/src/ib_srpt.c
@@ -2098,7 +2098,7 @@ static void srpt_free_ch(struct kref *kref)
srpt_destroy_ch_ib(ch);
- kfree(ch);
+ kfree_rcu(ch, rcu);
}
static void srpt_unreg_ch(struct srpt_rdma_ch *ch)
@@ -2127,7 +2127,7 @@ static void srpt_unreg_ch(struct srpt_rdma_ch *ch)
* after list_del() and before wake_up() has been invoked.
*/
mutex_lock(&sport->mutex);
- list_del(&ch->list);
+ list_del_rcu(&ch->list);
wake_up(&sport->ch_releaseQ);
mutex_unlock(&sport->mutex);
@@ -2397,7 +2397,8 @@ static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport,
}
}
if (!nexus && tmp_nexus) {
- list_add_tail(&tmp_nexus->entry, &sport->nexus_list);
+ list_add_tail_rcu(&tmp_nexus->entry,
+ &sport->nexus_list);
swap(nexus, tmp_nexus);
}
mutex_unlock(&sport->mutex);
@@ -2695,7 +2696,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
rsp->rsp_flags = SRP_LOGIN_RSP_MULTICHAN_MAINTAINED;
}
- list_add_tail(&ch->list, &nexus->ch_list);
+ list_add_tail_rcu(&ch->list, &nexus->ch_list);
ch->thread = thread;
if (!sport->enabled) {
@@ -3841,11 +3842,11 @@ static bool srpt_ch_list_empty(struct srpt_port *sport)
struct srpt_nexus *nexus;
bool res = true;
- mutex_lock(&sport->mutex);
- list_for_each_entry(nexus, &sport->nexus_list, entry)
+ rcu_read_lock();
+ list_for_each_entry_rcu(nexus, &sport->nexus_list, entry)
if (!list_empty(&nexus->ch_list))
res = false;
- mutex_unlock(&sport->mutex);
+ rcu_read_unlock();
return res;
}
@@ -3885,8 +3886,8 @@ static int srpt_release_sport(struct srpt_port *sport)
mutex_lock(&sport->mutex);
list_for_each_entry_safe(nexus, next_n, &sport->nexus_list, entry) {
- list_del(&nexus->entry);
- kfree(nexus);
+ list_del_rcu(&nexus->entry);
+ kfree_rcu(nexus, rcu);
}
mutex_unlock(&sport->mutex);
@@ -4590,6 +4591,8 @@ out:
static void __exit srpt_cleanup_module(void)
{
+ rcu_barrier();
+
if (rdma_cm_id)
rdma_destroy_id(rdma_cm_id);
ib_unregister_client(&srpt_client);
diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h
index bbe52c011..fdf57791f 100644
--- a/srpt/src/ib_srpt.h
+++ b/srpt/src/ib_srpt.h
@@ -361,6 +361,7 @@ struct srpt_rdma_ch {
};
struct ib_cq *cq;
struct kref kref;
+ struct rcu_head rcu;
int rq_size;
int max_sge;
int max_rsp_size;
@@ -397,6 +398,7 @@ struct srpt_rdma_ch {
struct srpt_nexus {
struct list_head entry;
struct list_head ch_list;
+ struct rcu_head rcu;
u8 i_port_id[16];
u8 t_port_id[16];
};
From 53a9829a45d4939829a0719eaa10a3fa46ea8e06 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 01:40:41 +0000
Subject: [PATCH 032/121] ib_srpt: Fix a runtime warning
Avoid that the following warning is reported:
WARNING: CPU: 7 PID: 32692 at kernel/sched/core.c:7533 __might_sleep+0x82/0x90()
do not call blocking ops when !TASK_RUNNING; state=1 set at []
srpt_compl_thread+0xab/0x1c0 [ib_srpt]
Call Trace:
[] dump_stack+0x4f/0x74
[] warn_slowpath_common+0x8b/0xd0
[] warn_slowpath_fmt+0x41/0x70
[] __might_sleep+0x82/0x90
[] mempool_alloc+0x94/0x180
[] scst_alloc_mgmt_cmd+0x4c/0x120 [scst]
[] scst_pre_rx_mgmt_cmd+0x84/0x1e0 [scst]
[] scst_rx_mgmt_fn+0x8a/0x3e0 [scst]
[] scst_rx_mgmt_fn_lun+0x6e/0x90 [ib_srpt]
[] srpt_handle_tsk_mgmt+0x1c1/0x2f0 [ib_srpt]
[] srpt_handle_new_iu+0x1c0/0x230 [ib_srpt]
[] srpt_process_rcv_completion+0x89/0xd0 [ib_srpt]
[] srpt_process_one_compl+0x54/0x70 [ib_srpt]
[] srpt_poll+0x69/0x90 [ib_srpt]
[] srpt_process_completion+0x1e/0x40 [ib_srpt]
[] srpt_compl_thread+0xdc/0x1c0 [ib_srpt]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6727 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
srpt/src/ib_srpt.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c
index 2d2895335..115175845 100644
--- a/srpt/src/ib_srpt.c
+++ b/srpt/src/ib_srpt.c
@@ -2068,13 +2068,18 @@ static int srpt_poll(struct srpt_rdma_ch *ch, int budget)
return processed;
}
-static int srpt_process_completion(struct srpt_rdma_ch *ch, int budget)
+static int srpt_process_completion(struct srpt_rdma_ch *ch, int budget,
+ bool thread_context)
{
struct ib_cq *const cq = ch->cq;
int processed = 0, n = budget;
do {
+ if (thread_context)
+ set_current_state(TASK_RUNNING);
processed += srpt_poll(ch, n);
+ if (thread_context)
+ set_current_state(TASK_INTERRUPTIBLE);
n = ib_req_notify_cq(cq, IB_CQ_NEXT_COMP |
IB_CQ_REPORT_MISSED_EVENTS);
} while (n > 0);
@@ -2143,6 +2148,7 @@ static int srpt_compl_thread(void *arg)
{
enum { poll_budget = 65536 };
struct srpt_rdma_ch *ch;
+ int n;
/* Hibernation / freezing of the SRPT kernel thread is not supported. */
current->flags |= PF_NOFREEZE;
@@ -2151,8 +2157,10 @@ static int srpt_compl_thread(void *arg)
BUG_ON(!ch);
while (ch->state < CH_LIVE) {
- set_current_state(TASK_INTERRUPTIBLE);
- if (srpt_process_completion(ch, poll_budget) >= poll_budget)
+ n = srpt_process_completion(ch, poll_budget, true);
+ if (ch->state >= CH_LIVE)
+ break;
+ if (n >= poll_budget)
cond_resched();
else
schedule();
@@ -2161,8 +2169,10 @@ static int srpt_compl_thread(void *arg)
srpt_process_wait_list(ch);
while (ch->state < CH_DISCONNECTED) {
- set_current_state(TASK_INTERRUPTIBLE);
- if (srpt_process_completion(ch, poll_budget) >= poll_budget)
+ n = srpt_process_completion(ch, poll_budget, true);
+ if (ch->state >= CH_DISCONNECTED)
+ break;
+ if (n >= poll_budget)
cond_resched();
else
schedule();
From 10998483979d9b2d2297e57ee9430b69522849b3 Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Fri, 11 Dec 2015 01:51:31 +0000
Subject: [PATCH 033/121] scst: small addition to r6724
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6728 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c
index 512d0bae1..6bd731c80 100644
--- a/scst/src/scst_main.c
+++ b/scst/src/scst_main.c
@@ -647,8 +647,13 @@ again:
/*
* Testing tgt->sysfs_sess_list below without holding scst_mutex
- * is safe because 'tgt' won't disappear until scst_free_tgt() is
- * called below and because the mutex_lock(&scst_mutex) call below
+ * is safe, because:
+ *
+ * - On the init path no attempts to create new sessions for this
+ * target can be done in a race with this function (see above)
+ *
+ * - On the shutdown path 'tgt' won't disappear until scst_free_tgt()
+ * is called below and because the mutex_lock(&scst_mutex) call below
* waits until scst_free_session() has finished accessing the 'tgt'
* object.
*/
From 2b4abe603a50a29230022f7852f3fd57e246c974 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 05:52:45 +0000
Subject: [PATCH 034/121] scst/include/backport.h: Add kfree_rcu() definition
for kernels < 3.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6730 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/include/backport.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/scst/include/backport.h b/scst/include/backport.h
index 480b13e3c..8f7c53478 100644
--- a/scst/include/backport.h
+++ b/scst/include/backport.h
@@ -365,6 +365,21 @@ static inline __attribute__ ((format (printf, 1, 2)))
int no_printk(const char *s, ...) { return 0; }
#endif
+/* */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
+typedef void (*rcu_callback_t)(struct rcu_head *);
+#define __is_kfree_rcu_offset(offset) ((offset) < 4096)
+#define kfree_call_rcu(head, rcb) call_rcu(head, rcb)
+#define __kfree_rcu(head, offset) \
+ do { \
+ BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \
+ kfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \
+ } while (0)
+#define kfree_rcu(ptr, rcu_head) \
+ __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
+#endif
+
/* */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && \
From e4a852e599ca8827304c21ea9c32bfc757d23e56 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 17:39:55 +0000
Subject: [PATCH 035/121] scstadmin regression tests: Rename two files
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6731 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
.../t/{after-restore.conf => 06-after-restore.conf} | 0
scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t | 4 ++--
.../t/{to-be-restored.conf => 06-to-be-restored.conf} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename scstadmin/scstadmin.sysfs/scst-0.9.10/t/{after-restore.conf => 06-after-restore.conf} (100%)
rename scstadmin/scstadmin.sysfs/scst-0.9.10/t/{to-be-restored.conf => 06-to-be-restored.conf} (100%)
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/after-restore.conf b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-after-restore.conf
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/after-restore.conf
rename to scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-after-restore.conf
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
index ada3d17a4..c91b85c7e 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
@@ -64,6 +64,6 @@ die("Creation of SCST object failed") if (!defined($SCST));
setup($SCST);
-testRestoreConfig(File::Spec->catfile($testdir, "to-be-restored.conf"),
- File::Spec->catfile($testdir, "after-restore.conf"));
+testRestoreConfig(File::Spec->catfile($testdir, "06-to-be-restored.conf"),
+ File::Spec->catfile($testdir, "06-after-restore.conf"));
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/to-be-restored.conf b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-to-be-restored.conf
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/to-be-restored.conf
rename to scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-to-be-restored.conf
From 9484c62c419e757e28a0e77a86d83e27e482bb18 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 18:31:49 +0000
Subject: [PATCH 036/121] scstadmin.sysfs/Makefile: Add and comment out
TEST_VERBOSE=1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6732 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scstadmin/scstadmin.sysfs/Makefile b/scstadmin/scstadmin.sysfs/Makefile
index 3a41eeb89..e9c01f486 100644
--- a/scstadmin/scstadmin.sysfs/Makefile
+++ b/scstadmin/scstadmin.sysfs/Makefile
@@ -24,7 +24,7 @@ perl-module:
$(MAKE) -C scst-$(MODULE_VERSION)
test:
- $(MAKE) -C scst-$(MODULE_VERSION) test
+ $(MAKE) -C scst-$(MODULE_VERSION) test #TEST_VERBOSE=1
clean:
-$(MAKE) -C scst-$(MODULE_VERSION) clean
From 094a6be70db37ea64308d9a7a3b841ed75b688da Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 18:33:17 +0000
Subject: [PATCH 037/121] scstadmin: Add a seventh regression test
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6733 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
.../scst-0.9.10/t/07-result.conf | 14 +++
.../scst-0.9.10/t/07-scstadmin-args.t | 85 +++++++++++++++++++
2 files changed, 99 insertions(+)
create mode 100644 scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
create mode 100644 scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
new file mode 100644
index 000000000..d11c5f262
--- /dev/null
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
@@ -0,0 +1,14 @@
+# Automatically generated by SCST Configurator v...
+
+
+TARGET_DRIVER scst_local {
+ TARGET local {
+ GROUP ig {
+
+ INITIATOR ini1
+
+ INITIATOR ini2
+ }
+ }
+}
+
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
new file mode 100644
index 000000000..accea98f5
--- /dev/null
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
@@ -0,0 +1,85 @@
+#!perl
+
+use strict;
+use Cwd qw(abs_path);
+use File::Basename;
+use File::Spec;
+use Test;
+
+my $testdir;
+my $scstadmin_pm_dir;
+my $scstadmin_dir;
+my $scstadmin;
+my $redirect_file = "/tmp/07-output.txt";
+my $redirect = ">>$redirect_file";
+my $redirect = ">/dev/null";
+
+BEGIN {
+ unlink($redirect_file);
+ $testdir = dirname(abs_path($0));
+ $scstadmin_pm_dir = dirname($testdir);
+ $scstadmin_dir = dirname($scstadmin_pm_dir);
+ $scstadmin = File::Spec->catfile($scstadmin_dir, "scstadmin");
+ unless(grep /blib/, @INC) {
+ unshift(@INC, File::Spec->catdir($scstadmin_pm_dir, "lib"));
+ }
+ plan tests => 2;
+}
+
+use Data::Dumper;
+use SCST::SCST;
+use File::Temp qw/tempfile/;
+
+sub setup {
+ my $SCST = shift;
+
+ my ($drivers, $errorString) = $SCST->drivers();
+ my %drivers = map { $_ => 1 } @{$drivers};
+ ok(exists($drivers{'scst_local'}));
+}
+
+sub attributeTest {
+ my $expected = shift;
+ my $tmpfilename1 = File::Spec->catfile(File::Spec->tmpdir(),
+ "scstadmin-test-07-$$-1");
+ my $tmpfilename2 = File::Spec->catfile(File::Spec->tmpdir(),
+ "scstadmin-test-07-$$-2");
+ my $diff = File::Spec->catfile(File::Spec->tmpdir(),
+ "scstadmin-test-07-$$-diff");
+
+ system("$scstadmin -clear_config -force -noprompt -no_lip $redirect");
+ system("$scstadmin -open_dev nodev -handler vdisk_nullio -attributes dummy=1,read_zero=1 $redirect");
+ system("$scstadmin -open_dev disk0 -handler vdisk_fileio -attributes filename=/dev/zero,read_only=1 $redirect");
+ system("$scstadmin -open_dev disk1 -handler vdisk_fileio -attributes filename=/dev/zero,nv_cache=1 $redirect");
+ system("$scstadmin -driver scst_local -add_target local $redirect");
+ system("$scstadmin -driver scst_local -target local " .
+ "-add_lun 0 -device nodev $redirect");
+ system("$scstadmin -driver scst_local -target local -add_group ig " .
+ "$redirect");
+ system("$scstadmin -driver scst_local -target local -group ig " .
+ "-add_init ini1 $redirect");
+ system("$scstadmin -driver scst_local -target local -group ig " .
+ "-add_init ini2 $redirect");
+ system("$scstadmin -driver scst_local -target local -group ig " .
+ "-add_lun 0 -device disk0 $redirect");
+ system("$scstadmin -driver scst_local -target local -group ig " .
+ "-add_lun 1 -device disk1 $redirect");
+ system("$scstadmin -write_config $tmpfilename1 >/dev/null");
+ system("awk 'BEGIN { t = 0 } /^# Automatically generated by SCST Configurator v/ { \$0 = \"# Automatically generated by SCST Configurator v...\" } /^TARGET_DRIVER.*{\$/ { if (\$0 != \"TARGET_DRIVER scst_local {\") t = 1 } /^}\$/ { if (t == 1) t = 2 } /^\$/ { if (t == 2) { t = 3 } } /^./ { if (t == 3) { t = 0 } } { if (t == 0) print }' <$tmpfilename1 >$tmpfilename2");
+ my $compare_result = system("diff -u $tmpfilename2 $expected >$diff");
+ ok($compare_result, 0);
+ if ($compare_result == 0) {
+ unlink($tmpfilename2);
+ unlink($tmpfilename1);
+ }
+}
+
+my $_DEBUG_ = 0;
+
+my $SCST = eval { new SCST::SCST($_DEBUG_) };
+die("Creation of SCST object failed") if (!defined($SCST));
+
+setup($SCST);
+
+attributeTest(File::Spec->catfile($testdir, "07-result.conf"));
+
From 749c8a3e75a910520a5eae3baa82b24ba232875c Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 18:34:39 +0000
Subject: [PATCH 038/121] scstadmin: Fix -attributes behavior for multiple
attributes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6734 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
index 2eb5055e2..e5c8a2d55 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
@@ -2224,7 +2224,7 @@ sub addLun {
my $o_string = "";
foreach my $attribute (keys %{$attributes}) {
my $value = $$attributes{$attribute};
- $o_string .= "$attribute=$value; ";
+ $o_string .= "$attribute=$value;";
}
$o_string =~ s/\s$//;
@@ -2415,7 +2415,7 @@ sub replaceLun {
my $o_string = "";
foreach my $attribute (keys %{$attributes}) {
my $value = $$attributes{$attribute};
- $o_string .= "$attribute=$value; ";
+ $o_string .= "$attribute=$value;";
}
$o_string =~ s/\s$//;
@@ -4135,7 +4135,7 @@ sub openDevice {
my $o_string = "";
foreach my $attribute (keys %{$attributes}) {
my $value = $$attributes{$attribute};
- $o_string .= "$attribute=$value; ";
+ $o_string .= "$attribute=$value;";
}
$o_string =~ s/\s$//;
From 957b51a997d424e4c670f2677a73d152c6308cf7 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 18:35:34 +0000
Subject: [PATCH 039/121] scstadmin, FC: By default, do not issue LIP. Add
option -lip.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/scstadmin | 278 ++++++++++++++++++++++------
1 file changed, 220 insertions(+), 58 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin
index 4a5b4556c..fc908f6c7 100755
--- a/scstadmin/scstadmin.sysfs/scstadmin
+++ b/scstadmin/scstadmin.sysfs/scstadmin
@@ -204,8 +204,10 @@ Target Driver Operations
-issue_lip []
[-driver ] : Issue a LIP for a specific driver/target or for
all drivers and targets.
- -no_lip : Don\'t automatically issue a LIP after applying
+ -lip : Issue a LIP after having applied FC
configuration changes.
+ -no_lip : Don\'t automatically issue a LIP after having
+ applied FC configuration changes.
Options
-nonkey : When writing a config file or listing attributes,
@@ -349,6 +351,7 @@ sub getArgs {
my $enableTarget;
my $disableTarget;
my $issueLip;
+ my $lip;
my $noLip;
my $handler;
@@ -444,6 +447,7 @@ sub getArgs {
'enable_target=s' => \$enableTarget,
'disable_target=s' => \$disableTarget,
'issue_lip:s' => \$issueLip,
+ 'lip' => \$lip,
'no_lip' => \$noLip,
'handler=s' => \$handler,
@@ -478,9 +482,10 @@ sub getArgs {
$_NOPROMPT_ = TRUE if (defined($_NOPROMPT_));
$_CONT_ON_ERR_ = TRUE if (defined($_CONT_ON_ERR_));
- $force = TRUE if (defined($force));
+ $force = TRUE if (defined($force));
$nonkey = TRUE if (defined($nonkey));
- $noLip = TRUE if (defined($noLip));
+ $lip = TRUE if (defined($lip));
+ $noLip = TRUE if (defined($noLip));
my $query_mode = defined($listHandler) || defined($listDevice) || defined($listDeviceGroup) || defined($listTargetGroup) ||
defined($listDriver) || defined($listTarget) || defined($listGroup) || defined($listSessions) ||
@@ -707,25 +712,104 @@ sub getArgs {
}
}
- return ($applyConfig, $clearConfig, $writeConfig, $checkConfig,
- $listScstAttr, $listHandler, $listDevice, $listDeviceGroup, $listTargetGroup, $listDriver, $listTarget, $listGroup,
- $listSessions, $listHandlerAttr, $listDeviceAttr, $listDriverAttr, $listTargetAttr,
- $listDeviceGroupAttr, $listTargetGroupAttr, $listTargetGroupTargetAttr,
- $listGroupAttr, $listLunAttr, $listInitiatorAttr, $setScstAttr, $setHandlerAttr,
- $setDeviceAttr, $setDriverAttr, $setTargetAttr, $setGroupAttr, $setLunAttr, $setInitiatorAttr,
- $setDeviceGroupAttr, $setTargetGroupAttr, $setTargetGroupTargetAttr,
- $addDriverAttr, $addTargetAttr, $remDriverAttr, $remTargetAttr,
- $openDev, $closeDev, $resyncDev,
- $addDevGroup, $removeDevGroup, $addDevGroupDevice, $removeDevGroupDevice,
- $addTargetGroup, $removeTargetGroup, $addTargetGroupTarget, $removeTargetGroupTarget,
- $addTarget, $removeTarget,
- $addGroup, $removeGroup,
- $addInitiator, $removeInitiator, $moveInitiator, $clearInitiators,
- $addLun, $removeLun, $replaceLun, $clearLuns,
- $enableTarget, $disableTarget, $issueLip, $noLip,
- $handler, \%_attributes,
- $driver, $target, $group, $to, $device,, $deviceGroup, $targetGroup,
- $nonkey, $force);
+ my %args = (
+ applyConfig => $applyConfig,
+ clearConfig => $clearConfig,
+ writeConfig => $writeConfig,
+ checkConfig => $checkConfig,
+
+ listScstAttr => $listScstAttr,
+ listHandler => $listHandler,
+ listDevice => $listDevice,
+ listDeviceGroup => $listDeviceGroup,
+ listTargetGroup => $listTargetGroup,
+ listDriver => $listDriver,
+ listTarget => $listTarget,
+ listGroup => $listGroup,
+
+ listSessions => $listSessions,
+ listHandlerAttr => $listHandlerAttr,
+ listDeviceAttr => $listDeviceAttr,
+ listDriverAttr => $listDriverAttr,
+ listTargetAttr => $listTargetAttr,
+
+ listDeviceGroupAttr => $listDeviceGroupAttr,
+ listTargetGroupAttr => $listTargetGroupAttr,
+ listTargetGroupTargetAttr => $listTargetGroupTargetAttr,
+
+ listGroupAttr => $listGroupAttr,
+ listLunAttr => $listLunAttr,
+ listInitiatorAttr => $listInitiatorAttr,
+ setScstAttr => $setScstAttr,
+ setHandlerAttr => $setHandlerAttr,
+
+ setDeviceAttr => $setDeviceAttr,
+ setDriverAttr => $setDriverAttr,
+ setTargetAttr => $setTargetAttr,
+ setGroupAttr => $setGroupAttr,
+ setLunAttr => $setLunAttr,
+ setInitiatorAttr => $setInitiatorAttr,
+
+ setDeviceGroupAttr => $setDeviceGroupAttr,
+ setTargetGroupAttr => $setTargetGroupAttr,
+ setTargetGroupTargetAttr => $setTargetGroupTargetAttr,
+
+ addDriverAttr => $addDriverAttr,
+ addTargetAttr => $addTargetAttr,
+ remDriverAttr => $remDriverAttr,
+ remTargetAttr => $remTargetAttr,
+
+ openDev => $openDev,
+ closeDev => $closeDev,
+ resyncDev => $resyncDev,
+
+ addDevGroup => $addDevGroup,
+ removeDevGroup => $removeDevGroup,
+ addDevGroupDevice => $addDevGroupDevice,
+ removeDevGroupDevice => $removeDevGroupDevice,
+
+ addTargetGroup => $addTargetGroup,
+ removeTargetGroup => $removeTargetGroup,
+ addTargetGroupTarget => $addTargetGroupTarget,
+ removeTargetGroupTarget => $removeTargetGroupTarget,
+
+ addTarget => $addTarget,
+ removeTarget => $removeTarget,
+
+ addGroup => $addGroup,
+ removeGroup => $removeGroup,
+
+ addInitiator => $addInitiator,
+ removeInitiator => $removeInitiator,
+ moveInitiator => $moveInitiator,
+ clearInitiators => $clearInitiators,
+
+ addLun => $addLun,
+ removeLun => $removeLun,
+ replaceLun => $replaceLun,
+ clearLuns => $clearLuns,
+
+ enableTarget => $enableTarget,
+ disableTarget => $disableTarget,
+ issueLip => $issueLip,
+ lip => $lip,
+ noLip => $noLip,
+
+ handler => $handler,
+ attributes => \%_attributes,
+
+ driver => $driver,
+ target => $target,
+ group => $group,
+ to => $to,
+ device => $device,
+ deviceGroup => $deviceGroup,
+ targetGroup => $targetGroup,
+
+ nonkey => $nonkey,
+ force => $force,
+ );
+ return \%args;
}
sub main {
@@ -736,25 +820,103 @@ sub main {
# We need to run as root
if ( $> ) {die("This program must run as root.\n");}
- my ($applyConfig, $clearConfig, $writeConfig, $checkConfig,
- $listScstAttr, $listHandler, $listDevice, $listDeviceGroup, $listTargetGroup, $listDriver, $listTarget, $listGroup,
- $listSessions, $listHandlerAttr, $listDeviceAttr, $listDriverAttr, $listTargetAttr,
- $listDeviceGroupAttr, $listTargetGroupAttr, $listTargetGroupTargetAttr,
- $listGroupAttr, $listLunAttr, $listInitiatorAttr, $setScstAttr, $setHandlerAttr,
- $setDeviceAttr, $setDriverAttr, $setTargetAttr, $setGroupAttr, $setLunAttr, $setInitiatorAttr,
- $setDeviceGroupAttr, $setTargetGroupAttr, $setTargetGroupTargetAttr,
- $addDriverAttr, $addTargetAttr, $remDriverAttr, $remTargetAttr,
- $openDev, $closeDev, $resyncDev,
- $addDevGroup, $removeDevGroup, $addDevGroupDevice, $removeDevGroupDevice,
- $addTargetGroup, $removeTargetGroup, $addTargetGroupTarget, $removeTargetGroupTarget,
- $addTarget, $removeTarget,
- $addGroup, $removeGroup,
- $addInitiator, $removeInitiator, $moveInitiator, $clearInitiators,
- $addLun, $removeLun, $replaceLun, $clearLuns,
- $enableTarget, $disableTarget, $issueLip, $noLip,
- $handler, $attributes,
- $driver, $target, $group, $to, $device, $deviceGroup, $targetGroup,
- $nonkey, $force) = getArgs();
+ my $args = getArgs();
+
+ my $applyConfig = $args->{applyConfig};
+ my $clearConfig = $args->{clearConfig};
+ my $writeConfig = $args->{writeConfig};
+ my $checkConfig = $args->{checkConfig};
+
+ my $listScstAttr = $args->{listScstAttr};
+ my $listHandler = $args->{listHandler};
+ my $listDevice = $args->{listDevice};
+ my $listDeviceGroup = $args->{listDeviceGroup};
+ my $listTargetGroup = $args->{listTargetGroup};
+ my $listDriver = $args->{listDriver};
+ my $listTarget = $args->{listTarget};
+ my $listGroup = $args->{listGroup};
+
+ my $listSessions = $args->{listSessions};
+ my $listHandlerAttr = $args->{listHandlerAttr};
+ my $listDeviceAttr = $args->{listDeviceAttr};
+ my $listDriverAttr = $args->{listDriverAttr};
+ my $listTargetAttr = $args->{listTargetAttr};
+
+ my $listDeviceGroupAttr = $args->{listDeviceGroupAttr};
+ my $listTargetGroupAttr = $args->{listTargetGroupAttr};
+ my $listTargetGroupTargetAttr = $args->{listTargetGroupTargetAttr};
+
+ my $listGroupAttr = $args->{listGroupAttr};
+ my $listLunAttr = $args->{listLunAttr};
+ my $listInitiatorAttr = $args->{listInitiatorAttr};
+ my $setScstAttr = $args->{setScstAttr};
+ my $setHandlerAttr = $args->{setHandlerAttr};
+
+ my $setDeviceAttr = $args->{setDeviceAttr};
+ my $setDriverAttr = $args->{setDriverAttr};
+ my $setTargetAttr = $args->{setTargetAttr};
+ my $setGroupAttr = $args->{setGroupAttr};
+ my $setLunAttr = $args->{setLunAttr};
+ my $setInitiatorAttr = $args->{setInitiatorAttr};
+
+ my $setDeviceGroupAttr = $args->{setDeviceGroupAttr};
+ my $setTargetGroupAttr = $args->{setTargetGroupAttr};
+ my $setTargetGroupTargetAttr = $args->{setTargetGroupTargetAttr};
+
+ my $addDriverAttr = $args->{addDriverAttr};
+ my $addTargetAttr = $args->{addTargetAttr};
+ my $remDriverAttr = $args->{remDriverAttr};
+ my $remTargetAttr = $args->{remTargetAttr};
+
+ my $openDev = $args->{openDev};
+ my $closeDev = $args->{closeDev};
+ my $resyncDev = $args->{resyncDev};
+
+ my $addDevGroup = $args->{addDevGroup};
+ my $removeDevGroup = $args->{removeDevGroup};
+ my $addDevGroupDevice = $args->{addDevGroupDevice};
+ my $removeDevGroupDevice = $args->{removeDevGroupDevice};
+
+ my $addTargetGroup = $args->{addTargetGroup};
+ my $removeTargetGroup = $args->{removeTargetGroup};
+ my $addTargetGroupTarget = $args->{addTargetGroupTarget};
+ my $removeTargetGroupTarget = $args->{removeTargetGroupTarget};
+
+ my $addTarget = $args->{addTarget};
+ my $removeTarget = $args->{removeTarget};
+
+ my $addGroup = $args->{addGroup};
+ my $removeGroup = $args->{removeGroup};
+
+ my $addInitiator = $args->{addInitiator};
+ my $removeInitiator = $args->{removeInitiator};
+ my $moveInitiator = $args->{moveInitiator};
+ my $clearInitiators = $args->{clearInitiators};
+
+ my $addLun = $args->{addLun};
+ my $removeLun = $args->{removeLun};
+ my $replaceLun = $args->{replaceLun};
+ my $clearLuns = $args->{clearLuns};
+
+ my $enableTarget = $args->{enableTarget};
+ my $disableTarget = $args->{disableTarget};
+ my $issueLip = $args->{issueLip};
+ my $lip = $args->{lip};
+ my $noLip = $args->{noLip};
+
+ my $handler = $args->{handler};
+ my $attributes = $args->{attributes};
+
+ my $driver = $args->{driver};
+ my $target = $args->{target};
+ my $group = $args->{group};
+ my $to = $args->{to};
+ my $device = $args->{device};
+ my $deviceGroup = $args->{deviceGroup};
+ my $targetGroup = $args->{targetGroup};
+
+ my $nonkey = $args->{nonkey};
+ my $force = $args->{force};
$SCST = new SCST::SCST($_DEBUG_);
@@ -770,7 +932,7 @@ sub main {
condExit("Configuration has errors, aborting.") if ($rc);
last if ($force && prompt());
my $changes = applyConfiguration($force);
- $rc = issueLip() if ($changes && !$noLip);
+ $rc = issueLip() if ($changes && $lip);
last SWITCH;
};
defined($checkConfig) && do {
@@ -786,7 +948,7 @@ sub main {
defined($clearConfig) && do {
last if (prompt());
$rc = clearConfiguration();
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
last SWITCH;
};
defined($listHandler) && do {
@@ -945,14 +1107,14 @@ sub main {
defined($addDriverAttr) && do {
print "\n-> Making requested changes.\n";
$rc = addDriverDynamicAttributes($addDriverAttr, $attributes);
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
defined($addTargetAttr) && do {
print "\n-> Making requested changes.\n";
$rc = addTargetDynamicAttributes($driver, $addTargetAttr, $attributes);
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -960,7 +1122,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeDriverDynamicAttributes($remDriverAttr, $attributes);
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -968,7 +1130,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeTargetDynamicAttributes($driver, $remTargetAttr, $attributes);
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -982,14 +1144,14 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = closeDevice($handler, $closeDev, $force);
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
defined($resyncDev) && do {
print "\n-> Making requested changes.\n";
$rc = resyncDevice($resyncDev);
- $rc = issueLip() if (!$rc && !$noLip);
+ $rc = issueLip() if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1051,7 +1213,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeVirtualTarget($driver, $removeTarget);
- $rc = issueLip($driver) if (!$rc && !$noLip);
+ $rc = issueLip($driver) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1071,7 +1233,7 @@ sub main {
defined($addInitiator) && do {
print "\n-> Making requested changes.\n";
$rc = addInitiator($driver, $target, $group, $addInitiator);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1079,7 +1241,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeInitiator($driver, $target, $group, $removeInitiator);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1087,7 +1249,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = moveInitiator($driver, $target, $group, $moveInitiator, $to);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1095,14 +1257,14 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = clearInitiators($driver, $target, $group);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
defined($addLun) && do {
print "\n-> Making requested changes.\n";
$rc = addLun($driver, $target, $device, $addLun, $attributes, $group);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1110,7 +1272,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = removeLun($driver, $target, $removeLun, $group);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1118,7 +1280,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = replaceLun($driver, $target, $group, $replaceLun, $device, $attributes);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
@@ -1126,7 +1288,7 @@ sub main {
last if (prompt());
print "\n-> Making requested changes.\n";
$rc = clearLuns($driver, $target, $group);
- $rc = issueLip($driver, $target) if (!$rc && !$noLip);
+ $rc = issueLip($driver, $target) if (!$rc && $lip);
print "\t-> Done.\n";
last SWITCH;
};
From d25d044b3f1f82fa97c6af9c7190ed395d9b6edf Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 20:03:09 +0000
Subject: [PATCH 040/121] scstadmin: Fix SCST/SCST.pm path
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6736 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/Makefile | 6 ++++--
scstadmin/scstadmin.sysfs/scstadmin | 17 ++++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/Makefile b/scstadmin/scstadmin.sysfs/Makefile
index e9c01f486..d86e3df78 100644
--- a/scstadmin/scstadmin.sysfs/Makefile
+++ b/scstadmin/scstadmin.sysfs/Makefile
@@ -13,14 +13,16 @@ install install_vendor: all
$(MAKE) -C scst-$(MODULE_VERSION) $@ DESTDIR=$(DESTDIR)
install -d $(DESTDIR)$(SBINDIR)
install -m 755 $(TOOL) $(DESTDIR)$(SBINDIR)
+ regex="s|%INSTALLSITELIB%|$$(make -sC scst-$(MODULE_VERSION) print-INSTALLSITELIB | grep -v ^make)|"; echo "$${regex}"; sed -i "$${regex}" $(DESTDIR)$(SBINDIR)/$(TOOL)
uninstall:
-rm -f $(DESTDIR)$(SBINDIR)/$(TOOL)
$(MAKE) -C scst-$(MODULE_VERSION) uninstall
perl-module:
- @cd ./scst-$(MODULE_VERSION); \
- perl Makefile.PL PREFIX=$(PREFIX);
+ @cd ./scst-$(MODULE_VERSION) && \
+ perl Makefile.PL PREFIX=$(PREFIX) && \
+ printf '\nprint-%%:\n\t@echo '"'"'$$($$*)'"'"'\n' >> Makefile
$(MAKE) -C scst-$(MODULE_VERSION)
test:
diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin
index fc908f6c7..fc5b1b3c1 100755
--- a/scstadmin/scstadmin.sysfs/scstadmin
+++ b/scstadmin/scstadmin.sysfs/scstadmin
@@ -242,12 +242,27 @@ Examples:
EndUsage
}
+use strict;
+use Cwd qw(abs_path);
+use File::Basename;
+use File::Spec;
+use Test;
+
+BEGIN {
+ my $site_lib = '%INSTALLSITELIB%';
+ if ($site_lib =~ '^%') {
+ my $scstadmindir = dirname(abs_path($0));
+ $site_lib = File::Spec->catdir($scstadmindir, "scst-0.9.10",
+ "blib", "lib");
+ }
+ unshift(@INC, $site_lib);
+}
+
use SCST::SCST 0.9.10;
use Getopt::Long;
use IO::File;
use IO::Dir;
use POSIX;
-use strict;
my $_DEF_CONFIG_ = '/etc/scst.conf';
From ed118eb69e9ffeb50db561503d25255315f6a31e Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 22:39:55 +0000
Subject: [PATCH 041/121] scstadmin: Fix regression test 7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6737 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
.../scst-0.9.10/t/07-result.conf | 24 +++++++++++++++++++
.../scst-0.9.10/t/07-scstadmin-args.t | 22 +++++++++++++----
2 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
index d11c5f262..8bee55a95 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
@@ -1,9 +1,33 @@
# Automatically generated by SCST Configurator v...
+HANDLER vdisk_fileio {
+ DEVICE disk0 {
+ filename /dev/scstadmin-regression-test-vdisk
+ read_only 1
+ }
+
+ DEVICE disk1 {
+ filename /dev/scstadmin-regression-test-vdisk
+ nv_cache 1
+ }
+}
+
+HANDLER vdisk_nullio {
+ DEVICE nodev {
+ dummy 1
+ }
+}
+
TARGET_DRIVER scst_local {
TARGET local {
+ LUN 0 nodev
+
GROUP ig {
+ LUN 0 disk0 {
+ read_only 1
+ }
+ LUN 1 disk1
INITIATOR ini1
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
index accea98f5..352481b90 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
+++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
@@ -11,8 +11,7 @@ my $scstadmin_pm_dir;
my $scstadmin_dir;
my $scstadmin;
my $redirect_file = "/tmp/07-output.txt";
-my $redirect = ">>$redirect_file";
-my $redirect = ">/dev/null";
+my $redirect;
BEGIN {
unlink($redirect_file);
@@ -36,6 +35,11 @@ sub setup {
my ($drivers, $errorString) = $SCST->drivers();
my %drivers = map { $_ => 1 } @{$drivers};
ok(exists($drivers{'scst_local'}));
+ system("dd if=/dev/zero of=/dev/scstadmin-regression-test-vdisk bs=1M count=1 >/dev/null 2>&1");
+}
+
+sub teardown {
+ system("rm -f /dev/scstadmin-regression-test-vdisk");
}
sub attributeTest {
@@ -48,9 +52,9 @@ sub attributeTest {
"scstadmin-test-07-$$-diff");
system("$scstadmin -clear_config -force -noprompt -no_lip $redirect");
- system("$scstadmin -open_dev nodev -handler vdisk_nullio -attributes dummy=1,read_zero=1 $redirect");
- system("$scstadmin -open_dev disk0 -handler vdisk_fileio -attributes filename=/dev/zero,read_only=1 $redirect");
- system("$scstadmin -open_dev disk1 -handler vdisk_fileio -attributes filename=/dev/zero,nv_cache=1 $redirect");
+ system("$scstadmin -open_dev nodev -handler vdisk_nullio -attributes dummy=1 $redirect");
+ system("$scstadmin -open_dev disk0 -handler vdisk_fileio -attributes filename=/dev/scstadmin-regression-test-vdisk,read_only=1 $redirect");
+ system("$scstadmin -open_dev disk1 -handler vdisk_fileio -attributes filename=/dev/scstadmin-regression-test-vdisk,nv_cache=1 $redirect");
system("$scstadmin -driver scst_local -add_target local $redirect");
system("$scstadmin -driver scst_local -target local " .
"-add_lun 0 -device nodev $redirect");
@@ -75,6 +79,13 @@ sub attributeTest {
}
my $_DEBUG_ = 0;
+if ($_DEBUG_) {
+ $redirect = ">>$redirect_file";
+ open(my $logfile, '>>', $redirect_file);
+ select $logfile;
+} else {
+ $redirect = ">/dev/null";
+}
my $SCST = eval { new SCST::SCST($_DEBUG_) };
die("Creation of SCST object failed") if (!defined($SCST));
@@ -83,3 +94,4 @@ setup($SCST);
attributeTest(File::Spec->catfile($testdir, "07-result.conf"));
+teardown();
From b3dcab787a53df3c2d78ad08d7417e3777642f21 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 22:44:23 +0000
Subject: [PATCH 042/121] scstadmin: Bump SCST.pm version number from 0.9.10 to
1.0.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6738 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/Makefile | 2 +-
.../scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/MANIFEST | 0
.../scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/Makefile.PL | 0
scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/README | 0
.../{scst-0.9.10 => scst-1.0.0}/lib/SCST/SCST.pm | 2 +-
.../{scst-0.9.10 => scst-1.0.0}/t/01-start-scst.t | 0
.../{scst-0.9.10 => scst-1.0.0}/t/02-scst-attr.t | 0
.../{scst-0.9.10 => scst-1.0.0}/t/03-targets.t | 0
.../scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/04-alua.t | 0
.../{scst-0.9.10 => scst-1.0.0}/t/05-dynattr.t | 0
.../{scst-0.9.10 => scst-1.0.0}/t/06-after-restore.conf | 0
.../{scst-0.9.10 => scst-1.0.0}/t/06-cont-on-err.t | 0
.../{scst-0.9.10 => scst-1.0.0}/t/06-to-be-restored.conf | 0
.../{scst-0.9.10 => scst-1.0.0}/t/07-result.conf | 0
.../{scst-0.9.10 => scst-1.0.0}/t/07-scstadmin-args.t | 0
.../{scst-0.9.10 => scst-1.0.0}/t/99-stop-scst.t | 0
scstadmin/scstadmin.sysfs/scstadmin | 4 ++--
17 files changed, 4 insertions(+), 4 deletions(-)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/MANIFEST (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/Makefile.PL (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/README (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/lib/SCST/SCST.pm (99%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/01-start-scst.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/02-scst-attr.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/03-targets.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/04-alua.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/05-dynattr.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/06-after-restore.conf (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/06-cont-on-err.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/06-to-be-restored.conf (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/07-result.conf (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/07-scstadmin-args.t (100%)
rename scstadmin/scstadmin.sysfs/{scst-0.9.10 => scst-1.0.0}/t/99-stop-scst.t (100%)
diff --git a/scstadmin/scstadmin.sysfs/Makefile b/scstadmin/scstadmin.sysfs/Makefile
index d86e3df78..c728831ec 100644
--- a/scstadmin/scstadmin.sysfs/Makefile
+++ b/scstadmin/scstadmin.sysfs/Makefile
@@ -2,7 +2,7 @@ ifndef PREFIX
PREFIX=/usr/local
endif
-MODULE_VERSION = 0.9.10
+MODULE_VERSION = 1.0.0
TOOL = scstadmin
SBINDIR := $(PREFIX)/sbin
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/MANIFEST b/scstadmin/scstadmin.sysfs/scst-1.0.0/MANIFEST
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/MANIFEST
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/MANIFEST
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/Makefile.PL b/scstadmin/scstadmin.sysfs/scst-1.0.0/Makefile.PL
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/Makefile.PL
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/Makefile.PL
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/README b/scstadmin/scstadmin.sysfs/scst-1.0.0/README
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/README
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/README
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm
similarity index 99%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm
index e5c8a2d55..6bef8619b 100644
--- a/scstadmin/scstadmin.sysfs/scst-0.9.10/lib/SCST/SCST.pm
+++ b/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm
@@ -289,7 +289,7 @@ use vars qw(@ISA @EXPORT $VERSION);
use vars qw($TGT_TYPE_HARDWARE $TGT_TYPE_VIRTUAL);
-$VERSION = '0.9.10';
+$VERSION = '1.0.0';
$TGT_TYPE_HARDWARE = 1;
$TGT_TYPE_VIRTUAL = 2;
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/01-start-scst.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/01-start-scst.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/02-scst-attr.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/02-scst-attr.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/02-scst-attr.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/02-scst-attr.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/03-targets.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/03-targets.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/04-alua.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/04-alua.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/04-alua.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/04-alua.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/05-dynattr.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/05-dynattr.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/05-dynattr.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/05-dynattr.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-after-restore.conf b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-after-restore.conf
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-after-restore.conf
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-after-restore.conf
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-cont-on-err.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-to-be-restored.conf b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-to-be-restored.conf
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/06-to-be-restored.conf
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-to-be-restored.conf
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-result.conf
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/07-scstadmin-args.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t
diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/99-stop-scst.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/99-stop-scst.t
similarity index 100%
rename from scstadmin/scstadmin.sysfs/scst-0.9.10/t/99-stop-scst.t
rename to scstadmin/scstadmin.sysfs/scst-1.0.0/t/99-stop-scst.t
diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin
index fc5b1b3c1..b6bac0e8d 100755
--- a/scstadmin/scstadmin.sysfs/scstadmin
+++ b/scstadmin/scstadmin.sysfs/scstadmin
@@ -252,13 +252,13 @@ BEGIN {
my $site_lib = '%INSTALLSITELIB%';
if ($site_lib =~ '^%') {
my $scstadmindir = dirname(abs_path($0));
- $site_lib = File::Spec->catdir($scstadmindir, "scst-0.9.10",
+ $site_lib = File::Spec->catdir($scstadmindir, "scst-1.0.0",
"blib", "lib");
}
unshift(@INC, $site_lib);
}
-use SCST::SCST 0.9.10;
+use SCST::SCST 1.0.0;
use Getopt::Long;
use IO::File;
use IO::Dir;
From 7eb874c3bafa3cca1945d6f40a5d3b3c7f86c48e Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 11 Dec 2015 23:44:27 +0000
Subject: [PATCH 043/121] isert-scst: RHEL 7.2 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6739 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
iscsi-scst/Makefile | 5 ++++-
iscsi-scst/conftest/create_cq/Makefile | 3 +++
iscsi-scst/conftest/create_cq/create_cq.c | 13 +++++++++++++
iscsi-scst/kernel/isert-scst/iser_rdma.c | 2 +-
4 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 iscsi-scst/conftest/create_cq/Makefile
create mode 100644 iscsi-scst/conftest/create_cq/create_cq.c
diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile
index 1df57d882..d1969de05 100644
--- a/iscsi-scst/Makefile
+++ b/iscsi-scst/Makefile
@@ -100,12 +100,15 @@ else
endif
endif
+CREATE_CQ_FLAG = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/create_cq PRE_CFLAGS="$(OFED_CFLAGS) -Werror" >/dev/null 2>&1 && echo -DIB_CREATE_CQ_HAS_INIT_ATTR)
+PRE_CFLAGS=$(OFED_CFLAGS) $(CREATE_CQ_FLAG) -DOFED_FLAVOR=$(OFED_FLAVOR)
+
mods: Modules.symvers Module.symvers
$(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(KMOD) modules
if $(INFINIBAND_ENABLED); then \
echo " Building against $(OFED_FLAVOR) InfiniBand kernel headers."; \
$(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) SUBDIRS=$(ISERTMOD) \
- PRE_CFLAGS="$(OFED_CFLAGS) -DOFED_FLAVOR=$(OFED_FLAVOR)" \
+ PRE_CFLAGS="$(PRE_CFLAGS)" \
KBUILD_EXTRA_SYMBOLS=$(ISER_SYMVERS) modules; \
fi
diff --git a/iscsi-scst/conftest/create_cq/Makefile b/iscsi-scst/conftest/create_cq/Makefile
new file mode 100644
index 000000000..d7ada9b0a
--- /dev/null
+++ b/iscsi-scst/conftest/create_cq/Makefile
@@ -0,0 +1,3 @@
+LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
+
+obj-m += create_cq.o
diff --git a/iscsi-scst/conftest/create_cq/create_cq.c b/iscsi-scst/conftest/create_cq/create_cq.c
new file mode 100644
index 000000000..86fce929e
--- /dev/null
+++ b/iscsi-scst/conftest/create_cq/create_cq.c
@@ -0,0 +1,13 @@
+#include
+#include
+
+static int modinit(void)
+{
+ struct ib_cq *q;
+
+ q = ib_create_cq(NULL, NULL, NULL, NULL, NULL);
+
+ return q != 0;
+}
+
+module_init(modinit);
diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c
index 08050a221..3b48f5bea 100644
--- a/iscsi-scst/kernel/isert-scst/iser_rdma.c
+++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c
@@ -963,7 +963,7 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
goto fail_cq;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
+#ifndef IB_CREATE_CQ_HAS_INIT_ATTR
cq = ib_create_cq(ib_dev,
isert_cq_comp_handler,
isert_async_evt_handler,
From 034f8bc3f1755b30f8c79ff2471f564b0c659a92 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sat, 12 Dec 2015 16:02:37 +0000
Subject: [PATCH 044/121] isert-scst: Unbreak nightly build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6740 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
iscsi-scst/kernel/isert-scst/iser_rdma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c
index 3b48f5bea..499a941fe 100644
--- a/iscsi-scst/kernel/isert-scst/iser_rdma.c
+++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c
@@ -963,7 +963,8 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
goto fail_cq;
}
-#ifndef IB_CREATE_CQ_HAS_INIT_ATTR
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) && \
+ !defined(IB_CREATE_CQ_HAS_INIT_ATTR)
cq = ib_create_cq(ib_dev,
isert_cq_comp_handler,
isert_async_evt_handler,
From fa45db4caf6ed6bcc94788b0d2117f3ae3125765 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 16 Dec 2015 08:41:09 +0000
Subject: [PATCH 045/121] scst, procfs: Fix two section mismatches
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6741 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_proc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c
index 0ade29717..f6415bcee 100644
--- a/scst/src/scst_proc.c
+++ b/scst/src/scst_proc.c
@@ -1110,7 +1110,7 @@ static int __init scst_proc_init_sgv(void)
return res;
}
-static void __exit scst_proc_cleanup_sgv(void)
+static void scst_proc_cleanup_sgv(void)
{
TRACE_ENTRY();
remove_proc_entry("sgv", scst_proc_scsi_tgt);
@@ -1217,7 +1217,7 @@ out_nomem:
goto out;
}
-void __exit scst_proc_cleanup_module(void)
+void scst_proc_cleanup_module(void)
{
TRACE_ENTRY();
From df2a2ac1ab12d61309b82624966df8e529624499 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 16 Dec 2015 08:44:04 +0000
Subject: [PATCH 046/121] iscsi-scst, procfs: Fix a compiler warning
Avoid that the compiler warns that attr_info is not used in the procfs
build.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6742 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
iscsi-scst/kernel/target.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/iscsi-scst/kernel/target.c b/iscsi-scst/kernel/target.c
index 7a3e0a546..b246e0d7a 100644
--- a/iscsi-scst/kernel/target.c
+++ b/iscsi-scst/kernel/target.c
@@ -128,7 +128,6 @@ int __add_target(struct iscsi_kern_target_info *info)
int err;
u32 tid = info->tid;
struct iscsi_target *target = NULL; /* to calm down sparse */
- struct iscsi_kern_attr *attr_info;
union add_info_union {
struct iscsi_kern_params_info params_info;
struct iscsi_kern_attr attr_info;
@@ -165,7 +164,6 @@ int __add_target(struct iscsi_kern_target_info *info)
err = -ENOMEM;
goto out;
}
- attr_info = (struct iscsi_kern_attr *)add_info;
if (tid == 0) {
do {
@@ -183,6 +181,9 @@ int __add_target(struct iscsi_kern_target_info *info)
nr_targets++;
#ifndef CONFIG_SCST_PROC
+ {
+ struct iscsi_kern_attr *attr_info = &add_info->attr_info;
+
mutex_lock(&target->target_mutex);
attrs_ptr_long = info->attrs_ptr;
@@ -208,6 +209,7 @@ int __add_target(struct iscsi_kern_target_info *info)
}
mutex_unlock(&target->target_mutex);
+ }
#endif
err = tid;
From 44901a0a11508242d27f08bcf46619d61eae36fa Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Thu, 17 Dec 2015 07:07:01 +0000
Subject: [PATCH 047/121] scst: Fix write-protected response
From SBC-4: "If present, any write protection shall cause otherwise
valid logical block access commands that request alteration of the
medium to be terminated by the device server with CHECK CONDITION
status with the sense key set to DATA PROTECT and the appropriate
additional sense code for the condition."
Hence set the additional sense code in responses to SCSI commands
sent to read-only LUNs.
Signed-off-by: Bart Van Assche
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6743 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/include/scst_const.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h
index caa54728c..a1e93f602 100644
--- a/scst/include/scst_const.h
+++ b/scst/include/scst_const.h
@@ -341,7 +341,7 @@ static inline int scst_sense_response_code(const uint8_t *sense)
#define scst_sense_reported_luns_data_changed UNIT_ATTENTION, 0x3F, 0xE
/* DATA_PROTECT is 7 */
-#define scst_sense_data_protect DATA_PROTECT, 0x00, 0
+#define scst_sense_data_protect DATA_PROTECT, 0x27, 0
/* ABORTED_COMMAND is 0xb */
#define scst_sense_aborted_command ABORTED_COMMAND, 0x00, 0
From 0553954a79b08a0c3c98c6e09755a16eb6ed0954 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Thu, 17 Dec 2015 16:10:53 +0000
Subject: [PATCH 048/121] nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6763 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
nightly/conf/nightly.conf | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf
index 67abb86e4..00b881921 100644
--- a/nightly/conf/nightly.conf
+++ b/nightly/conf/nightly.conf
@@ -3,26 +3,26 @@
ABT_DETAILS="x86_64"
ABT_JOBS=5
ABT_KERNELS=" \
-4.3 \
-4.2.6-nc \
-4.1.13-nc \
+4.3.3 \
+4.2.8-nc \
+4.1.15-nc \
4.0.9-nc \
-3.19.7-nc \
-3.18.24-nc \
+3.19.8-nc \
+3.18.25-nc \
3.17.8-nc \
3.16.7-nc \
3.15.10-nc \
-3.14.57-nc \
+3.14.58-nc \
3.13.11-nc \
3.12.51-nc \
3.11.10-nc \
-3.10.93-nc \
+3.10.94-nc \
3.9.11-nc \
3.8.13-nc \
3.7.10-nc \
3.6.11-nc \
3.5.7-nc \
-3.4.108-nc \
+3.4.110-nc \
3.3.8-nc \
3.2.74-nc \
3.1.10-nc \
From 41434a99054eb7f0b72194543cf84fc554aa4ae8 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 18 Dec 2015 11:05:20 +0000
Subject: [PATCH 049/121] scstadmin: Suppress warnings about the use of an
undefined value in numeric ne (!=)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6768 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm b/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm
index 6bef8619b..5fca60f2e 100644
--- a/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm
+++ b/scstadmin/scstadmin.sysfs/scst-1.0.0/lib/SCST/SCST.pm
@@ -929,7 +929,7 @@ sub driverExists {
opendir($dHandle, make_path(SCST_TARGETS_DIR(), $driver));
close $dHandle if ($result);
- return $result;
+ return $result ? TRUE : FALSE;
}
sub driverDynamicAttributes {
From 39c3b7949799a5a92e07b6fa5cce6b5d352d0530 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 18 Dec 2015 11:39:19 +0000
Subject: [PATCH 050/121] scst regression test 7: Fix $redirect_file
initialization
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6769 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
.../scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t
index 352481b90..58e149049 100644
--- a/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t
+++ b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-scstadmin-args.t
@@ -7,17 +7,16 @@ use File::Spec;
use Test;
my $testdir;
-my $scstadmin_pm_dir;
-my $scstadmin_dir;
my $scstadmin;
-my $redirect_file = "/tmp/07-output.txt";
+my $redirect_file;
my $redirect;
BEGIN {
+ $redirect_file = "/tmp/07-output.txt";
unlink($redirect_file);
$testdir = dirname(abs_path($0));
- $scstadmin_pm_dir = dirname($testdir);
- $scstadmin_dir = dirname($scstadmin_pm_dir);
+ my $scstadmin_pm_dir = dirname($testdir);
+ my $scstadmin_dir = dirname($scstadmin_pm_dir);
$scstadmin = File::Spec->catfile($scstadmin_dir, "scstadmin");
unless(grep /blib/, @INC) {
unshift(@INC, File::Spec->catdir($scstadmin_pm_dir, "lib"));
From 9294102efe5f528676c59a9c9d4816ed4eae691b Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 18 Dec 2015 12:11:18 +0000
Subject: [PATCH 051/121] scst: Fix a RHEL 6 compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6771 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/include/backport.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scst/include/backport.h b/scst/include/backport.h
index 8f7c53478..d379b735b 100644
--- a/scst/include/backport.h
+++ b/scst/include/backport.h
@@ -367,7 +367,7 @@ int no_printk(const char *s, ...) { return 0; }
/* */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) && !defined(kfree_rcu)
typedef void (*rcu_callback_t)(struct rcu_head *);
#define __is_kfree_rcu_offset(offset) ((offset) < 4096)
#define kfree_call_rcu(head, rcb) call_rcu(head, rcb)
From 10bc776195c4a1d6fe99741811483d264e12971c Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Fri, 18 Dec 2015 12:39:16 +0000
Subject: [PATCH 052/121] scst: Fix a procfs compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6773 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_priv.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h
index f0f87d8e3..df240b1fc 100644
--- a/scst/src/scst_priv.h
+++ b/scst/src/scst_priv.h
@@ -931,7 +931,11 @@ static inline int scst_cm_rcv_copy_res_exec(struct scst_cmd *cmd)
return SCST_EXEC_NOT_COMPLETED;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
+static inline void sess_cm_list_id_cleanup_work_fn(void *p) {}
+#else
static inline void sess_cm_list_id_cleanup_work_fn(struct work_struct *work) {}
+#endif
static inline void scst_cm_free_pending_list_ids(struct scst_session *sess) {}
static inline bool scst_cm_check_block_all_devs(struct scst_cmd *cmd) { return false; }
From 71f004f44c20ddcf1077d78f3b8af187c60fc7ba Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sun, 20 Dec 2015 12:46:16 +0000
Subject: [PATCH 053/121] scst: SLES 12 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6775 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_lib.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c
index 2a5599948..4c752e342 100644
--- a/scst/src/scst_lib.c
+++ b/scst/src/scst_lib.c
@@ -14401,7 +14401,9 @@ void scst_vfs_unlink_and_put(struct nameidata *nd)
void scst_vfs_unlink_and_put(struct path *path)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \
- (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7)
+ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) && \
+ (!defined(CONFIG_SUSE_KERNEL) || \
+ LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0))
vfs_unlink(path->dentry->d_parent->d_inode, path->dentry);
#else
vfs_unlink(path->dentry->d_parent->d_inode, path->dentry, NULL);
From a06cae9fe6fd4c5200bacbfaf7ff49bca20f9d0b Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Tue, 5 Jan 2016 15:27:11 +0000
Subject: [PATCH 054/121] scst_tg: Report that SCST supports the ALUA state
"transitioning"
Reported-by: Consus
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6777 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
scst/src/scst_tg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c
index 4029fcefb..4c49a7ee9 100644
--- a/scst/src/scst_tg.c
+++ b/scst/src/scst_tg.c
@@ -1540,7 +1540,8 @@ int scst_tg_get_group_info(void **buf, uint32_t *length,
*p++ = SCST_TG_SUP_OPTIMIZED
| SCST_TG_SUP_NONOPTIMIZED
| SCST_TG_SUP_STANDBY
- | SCST_TG_SUP_UNAVAILABLE;
+ | SCST_TG_SUP_UNAVAILABLE
+ | SCST_TG_SUP_TRANSITION;
put_unaligned_be16(tg->group_id, p);
p += 2;
p++; /* reserved */
From cf28155105d019b46819131bf3c21d9b597bc532 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Sat, 16 Jan 2016 02:42:17 +0000
Subject: [PATCH 055/121] nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6778 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
nightly/conf/nightly.conf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf
index 00b881921..72756f294 100644
--- a/nightly/conf/nightly.conf
+++ b/nightly/conf/nightly.conf
@@ -3,7 +3,8 @@
ABT_DETAILS="x86_64"
ABT_JOBS=5
ABT_KERNELS=" \
-4.3.3 \
+4.4 \
+4.3.3-nc \
4.2.8-nc \
4.1.15-nc \
4.0.9-nc \
From 120e5fb78b32f46e376e5fb06818f19c14a7a3aa Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Tue, 19 Jan 2016 18:08:04 +0000
Subject: [PATCH 056/121] nightly build: Add kernel 4.4 support files
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6779 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
qla2x00t/qla2x00-target/Makefile_in-tree-4.4 | 5 +++++
.../in-tree/Kconfig.drivers.Linux-4.4.patch | 13 +++++++++++++
scst/kernel/in-tree/Makefile.dev_handlers-4.4 | 14 ++++++++++++++
.../in-tree/Makefile.drivers.Linux-4.4.patch | 12 ++++++++++++
scst/kernel/in-tree/Makefile.scst-4.4 | 17 +++++++++++++++++
scst_local/in-tree/Makefile-4.4 | 2 ++
6 files changed, 63 insertions(+)
create mode 100644 qla2x00t/qla2x00-target/Makefile_in-tree-4.4
create mode 100644 scst/kernel/in-tree/Kconfig.drivers.Linux-4.4.patch
create mode 100644 scst/kernel/in-tree/Makefile.dev_handlers-4.4
create mode 100644 scst/kernel/in-tree/Makefile.drivers.Linux-4.4.patch
create mode 100644 scst/kernel/in-tree/Makefile.scst-4.4
create mode 100644 scst_local/in-tree/Makefile-4.4
diff --git a/qla2x00t/qla2x00-target/Makefile_in-tree-4.4 b/qla2x00t/qla2x00-target/Makefile_in-tree-4.4
new file mode 100644
index 000000000..9657aee84
--- /dev/null
+++ b/qla2x00t/qla2x00-target/Makefile_in-tree-4.4
@@ -0,0 +1,5 @@
+ccflags-y += -Idrivers/scsi/qla2xxx
+
+qla2x00tgt-y := qla2x00t.o
+
+obj-$(CONFIG_SCST_QLA_TGT_ADDON) += qla2x00tgt.o
diff --git a/scst/kernel/in-tree/Kconfig.drivers.Linux-4.4.patch b/scst/kernel/in-tree/Kconfig.drivers.Linux-4.4.patch
new file mode 100644
index 000000000..39d30a55e
--- /dev/null
+++ b/scst/kernel/in-tree/Kconfig.drivers.Linux-4.4.patch
@@ -0,0 +1,13 @@
+diff --git a/drivers/Kconfig b/drivers/Kconfig
+index c70d6e4..0a4ed1b 100644
+--- a/drivers/Kconfig
++++ b/drivers/Kconfig
+@@ -26,6 +26,8 @@ source "drivers/ide/Kconfig"
+
+ source "drivers/scsi/Kconfig"
+
++source "drivers/scst/Kconfig"
++
+ source "drivers/ata/Kconfig"
+
+ source "drivers/md/Kconfig"
diff --git a/scst/kernel/in-tree/Makefile.dev_handlers-4.4 b/scst/kernel/in-tree/Makefile.dev_handlers-4.4
new file mode 100644
index 000000000..f933b36f7
--- /dev/null
+++ b/scst/kernel/in-tree/Makefile.dev_handlers-4.4
@@ -0,0 +1,14 @@
+ccflags-y += -Wno-unused-parameter
+
+obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \
+ scst_vdisk.o scst_raid.o scst_processor.o scst_user.o
+
+obj-$(CONFIG_SCST_DISK) += scst_disk.o
+obj-$(CONFIG_SCST_TAPE) += scst_tape.o
+obj-$(CONFIG_SCST_CDROM) += scst_cdrom.o
+obj-$(CONFIG_SCST_MODISK) += scst_modisk.o
+obj-$(CONFIG_SCST_CHANGER) += scst_changer.o
+obj-$(CONFIG_SCST_RAID) += scst_raid.o
+obj-$(CONFIG_SCST_PROCESSOR) += scst_processor.o
+obj-$(CONFIG_SCST_VDISK) += scst_vdisk.o
+obj-$(CONFIG_SCST_USER) += scst_user.o
diff --git a/scst/kernel/in-tree/Makefile.drivers.Linux-4.4.patch b/scst/kernel/in-tree/Makefile.drivers.Linux-4.4.patch
new file mode 100644
index 000000000..6bbacd12f
--- /dev/null
+++ b/scst/kernel/in-tree/Makefile.drivers.Linux-4.4.patch
@@ -0,0 +1,12 @@
+diff --git a/drivers/Makefile b/drivers/Makefile
+index 527a6da..db2c24f 100644
+--- a/drivers/Makefile
++++ b/drivers/Makefile
+@@ -137,6 +137,7 @@ obj-$(CONFIG_SSB) += ssb/
+ obj-$(CONFIG_BCMA) += bcma/
+ obj-$(CONFIG_VHOST_RING) += vhost/
+ obj-$(CONFIG_VLYNQ) += vlynq/
++obj-$(CONFIG_SCST) += scst/
+ obj-$(CONFIG_STAGING) += staging/
+ obj-y += platform/
+ #common clk code
diff --git a/scst/kernel/in-tree/Makefile.scst-4.4 b/scst/kernel/in-tree/Makefile.scst-4.4
new file mode 100644
index 000000000..f4e0cc985
--- /dev/null
+++ b/scst/kernel/in-tree/Makefile.scst-4.4
@@ -0,0 +1,17 @@
+ccflags-y += -Wno-unused-parameter
+
+scst-y += scst_copy_mgr.o
+scst-y += scst_debug.o
+scst-y += scst_dlm.o
+scst-y += scst_event.o
+scst-y += scst_lib.o
+scst-y += scst_main.o
+scst-y += scst_mem.o
+scst-y += scst_no_dlm.o
+scst-y += scst_pres.o
+scst-y += scst_sysfs.o
+scst-y += scst_targ.o
+scst-y += scst_tg.o
+
+obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \
+ srpt/ scst_local/
diff --git a/scst_local/in-tree/Makefile-4.4 b/scst_local/in-tree/Makefile-4.4
new file mode 100644
index 000000000..8cbbbff63
--- /dev/null
+++ b/scst_local/in-tree/Makefile-4.4
@@ -0,0 +1,2 @@
+obj-$(CONFIG_SCST_LOCAL) += scst_local.o
+
From 76b1344cd3b706428c2c7c3c482e9c583fbd7a37 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Tue, 19 Jan 2016 18:08:36 +0000
Subject: [PATCH 057/121] ib_srpt: Fix in-tree build for kernel v4.4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6780 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
srpt/src/ib_srpt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c
index 115175845..eda399d6c 100644
--- a/srpt/src/ib_srpt.c
+++ b/srpt/src/ib_srpt.c
@@ -694,7 +694,8 @@ static int srpt_refresh_port(struct srpt_port *sport)
sport->lid = port_attr.lid;
ret = ib_query_gid(sport->sdev->device, sport->port, 0, &sport->gid
-#ifdef IB_QUERY_GID_HAS_ATTR_ARG
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) || \
+ defined(IB_QUERY_GID_HAS_ATTR_ARG)
, NULL
#endif
);
From c7ed845936e9fe7aa088400e869692c32238176d Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 20 Jan 2016 00:35:29 +0000
Subject: [PATCH 058/121] user space code: Fix the code for generating a
release archive
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6782 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
usr/events/Makefile | 2 +-
usr/fileio/Makefile | 2 +-
usr/stpgd/Makefile | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/usr/events/Makefile b/usr/events/Makefile
index ffce7d2d7..fa01f6b7f 100644
--- a/usr/events/Makefile
+++ b/usr/events/Makefile
@@ -97,6 +97,6 @@ extraclean: clean
rm Makefile.aa
release-archive:
- ../../scripts/generate-release-archive events "$$(sed -n 's/^#define[[:blank:]]VERSION_STR[[:blank:]]*\"\([^\"]*\)\".*/\1/p' events.c)"
+ ../../scripts/generate-release-archive events "$$(sed -n 's/^#define[[:blank:]]VERSION_STR[[:blank:]]*\"\([^\"]*\)\".*/\1/p' ../include/version.h)"
.PHONY: all install uninstall clean extraclean 2release 2debug 2perf
diff --git a/usr/fileio/Makefile b/usr/fileio/Makefile
index b91948369..5daa63b10 100644
--- a/usr/fileio/Makefile
+++ b/usr/fileio/Makefile
@@ -118,6 +118,6 @@ extraclean: clean
rm Makefile.aa
release-archive:
- ../../scripts/generate-release-archive fileio_tgt "$$(sed -n 's/^#define[[:blank:]]VERSION_STR[[:blank:]]*\"\([^\"]*\)\".*/\1/p' fileio.c)"
+ ../../scripts/generate-release-archive fileio_tgt "$$(sed -n 's/^#define[[:blank:]]VERSION_STR[[:blank:]]*\"\([^\"]*\)\".*/\1/p' ../include/version.h)"
.PHONY: all install uninstall clean extraclean 2release 2debug 2perf
diff --git a/usr/stpgd/Makefile b/usr/stpgd/Makefile
index 0f8336c95..3fa1e9bc7 100644
--- a/usr/stpgd/Makefile
+++ b/usr/stpgd/Makefile
@@ -99,6 +99,6 @@ extraclean: clean
rm Makefile.aa
release-archive:
- ../../scripts/generate-release-archive stpgd "$$(sed -n 's/^#define[[:blank:]]VERSION_STR[[:blank:]]*\"\([^\"]*\)\".*/\1/p' stpgd_main.c)"
+ ../../scripts/generate-release-archive stpgd "$$(sed -n 's/^#define[[:blank:]]VERSION_STR[[:blank:]]*\"\([^\"]*\)\".*/\1/p' ../include/version.h)"
.PHONY: all install uninstall clean extraclean 2release 2debug 2perf
From 1d3f1ada5af61ddbb82b0e75c2b35a7c1cffa6b8 Mon Sep 17 00:00:00 2001
From: Bart Van Assche
Date: Wed, 20 Jan 2016 16:40:19 +0000
Subject: [PATCH 059/121] nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6784 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
nightly/conf/nightly.conf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf
index 72756f294..44ec207ac 100644
--- a/nightly/conf/nightly.conf
+++ b/nightly/conf/nightly.conf
@@ -15,7 +15,7 @@ ABT_KERNELS=" \
3.15.10-nc \
3.14.58-nc \
3.13.11-nc \
-3.12.51-nc \
+3.12.52-nc \
3.11.10-nc \
3.10.94-nc \
3.9.11-nc \
@@ -25,7 +25,7 @@ ABT_KERNELS=" \
3.5.7-nc \
3.4.110-nc \
3.3.8-nc \
-3.2.74-nc \
+3.2.75-nc \
3.1.10-nc \
3.0.101-nc \
2.6.39.4-nc \
From 5968cb4567f1f25a53ed9e001248c337f2c096ab Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Fri, 22 Jan 2016 03:08:44 +0000
Subject: [PATCH 060/121] docs: version updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6785 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
doc/scst_user_spec.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/scst_user_spec.sgml b/doc/scst_user_spec.sgml
index 121e4df97..75f601928 100644
--- a/doc/scst_user_spec.sgml
+++ b/doc/scst_user_spec.sgml
@@ -10,7 +10,7 @@ SCST user space device handler interface description
Vladislav Bolkhovitin
-Version 3.0.0
+Version 3.2.0
From 1e75da42890cb1023d62cf9a81f7294f6c97a2df Mon Sep 17 00:00:00 2001
From: Vladislav Bolkhovitin
Date: Fri, 22 Jan 2016 03:54:38 +0000
Subject: [PATCH 061/121] 3.1 release web updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6786 d57e44dd-8a1f-0410-8b47-8ef2f437770f
---
www/downloads.html | 10 ++--------
www/handler_fileio_tgt.html | 2 +-
www/scst_admin.html | 2 +-
www/target_fcoe.html | 2 +-
www/target_iscsi.html | 2 +-
www/target_local.html | 2 +-
www/target_qla2x00t.html | 19 ++++++++-----------
www/target_srp.html | 4 ++--
8 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/www/downloads.html b/www/downloads.html
index 1b842330f..0e40e1772 100644
--- a/www/downloads.html
+++ b/www/downloads.html
@@ -35,8 +35,8 @@
SCST Downloads
-
The latest stable version of SCST is 3.0.1. The latest updates for it
- you can find it in the SVN branch 3.0.x.
+
The latest stable version of SCST is 3.1. The latest updates for it
+ you can find it in the SVN branch 3.1.x.
You can also download prebuilt SCST modules for
Scientific Linux CERN 5 (RHEL5-based),
@@ -57,8 +57,6 @@
svn checkout svn://svn.code.sf.net/p/scst/svn/trunk scst-trunk
-
Version 3.1 is currently in the RC features freeze phase and going to be released in the next few weeks. You can download it from 3.1.x branch.
-
Also you can find in the SCST SVN the latest updates for the stable branches. More information about accessing SVN repository may be found
here. Or, alternatively, you can download it as a GNU tarball from
here.
@@ -86,10 +84,6 @@
-
-
-
-
diff --git a/www/handler_fileio_tgt.html b/www/handler_fileio_tgt.html
index b38091767..932d878c3 100644
--- a/www/handler_fileio_tgt.html
+++ b/www/handler_fileio_tgt.html
@@ -66,7 +66,7 @@
All the words about BLOCKIO mode from SCST's README file apply to
O_DIRECT mode as well.
- The latest stable version is 3.0.1. Requires SCST version 3.0.1 or higher.
+ The latest stable version is 3.1 (as part of the SCST package). Requires SCST version 3.1 or higher.
You can find the latest development version of this handler in the SCST SVN. See the download page how to setup
access to it.
- The latest stable version is 3.0.1.
+ The latest stable version is 3.1.
- The latest stable version is 3.0.1. You can download the latest development version from the SCST SVN repository. See the download
+
The latest stable version is 3.1. You can download the latest development version from the SCST SVN repository. See the download
page how to setup access to it.
- The latest stable version is 3.0.1. Requires Linux kernel version 2.6.18.x or higher and SCST version 3.0.1 or higher.
+
The latest stable version is 3.1. Requires Linux kernel version 2.6.18.x or higher and SCST version 3.1 or higher.
Tested mostly on i386 and x86_64, but should work on any other supported by Linux platform.
You can find the latest development version of this driver in the SCST SVN. See the download page how to setup
access to it.
diff --git a/www/target_local.html b/www/target_local.html
index 8ca542423..056ae0726 100644
--- a/www/target_local.html
+++ b/www/target_local.html
@@ -68,7 +68,7 @@
This driver was made by Richard Sharpe.
- It is on the beta stage. The latest stabe version is 3.0.1. You can download
+
It is on the beta stage. The latest stabe version is 3.1. You can download
the latest development version from the SCST SVN repository. See the
download page how to setup access to it.
This is target driver for QLogic qla2xxx (22xx++) Fibre Channel adapters.
- There are 2 latest stable versions of this driver:
-
- - The first one is 3.0.1. It requires Linux kernel version 2.6.26.x or higher and
- SCST version 3.0.1 or higher. Driver in qla2x00t subdirectory is the old one, forked from
- qla2xxx from kernel 2.6.26. It does not support 16G QLogic adapters and is not maintained anymore.
- - Another version you can find in the SVN trunk. This driver supports 16G Hilda QLogic
+
This driver in version 3.1 supports 16G Hilda QLogic
chip based adapters (post-Hilda QLogic chips not supported) and has many other important improvements.
This driver should also support FCoE, but that has never been verified.
It has passed intensive internal SanDisk tests. It is stable and production ready.
This driver is in stable maintenance mode in favor of the
- QLogic git tree driver (see below). This is the recommended driver to use in production at the moment.
-
-
- The latest version of this driver with full support of the latest QLogic chips for both FC and FCoE you can find in
- git://git.qlogic.com/scst-qla2xxx.git. This driver also supports T10-PI functionality.
+ QLogic git tree driver (see below). This is the recommended driver to use in production at the moment.
+
+
+ You can find the latest updates for this driver in the SVN trunk.
+
+ The latest QLogic maintained version of this driver with full support of the latest QLogic chips for both FC and FCoE you can find in
+ git://git.qlogic.com/scst-qla2xxx.git. That version also supports T10-PI functionality.
It is maintained by QLogic, hence located in the QLogic's git. See SVN root README
for instructions how to integrate it into the SCST build tree. However, not all
improvements from the SVN trunk target driver have been integrated in this driver yet,
diff --git a/www/target_srp.html b/www/target_srp.html
index 09636b6dc..6587678a9 100644
--- a/www/target_srp.html
+++ b/www/target_srp.html
@@ -61,8 +61,8 @@
It is maintained by Bart Van Assche.
This driver is mainline Linux kernel ready and going to be pushed to it
together with other SCST patches.
- The latest stable version is 3.0.1.
-
+ The latest stable version is 3.1.
+