Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2016-04-20 14:04:46 -07:00
9 changed files with 44 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ endif
INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
INFINIBAND_ENABLED := $(shell if grep -q '^CONFIG_INFINIBAND=[my]$$' $(KDIR)/.config; then echo true; else echo false; fi)
all: include/iscsi_scst_itf_ver.h progs mods
all: progs mods
ISER_SYMVERS:=$(KMOD)/Module.symvers
OFED_CFLAGS:=
@@ -103,7 +103,7 @@ 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
mods: include/iscsi_scst_itf_ver.h 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."; \
@@ -112,7 +112,7 @@ mods: Modules.symvers Module.symvers
KBUILD_EXTRA_SYMBOLS=$(ISER_SYMVERS) modules; \
fi
progs:
progs: include/iscsi_scst_itf_ver.h
$(MAKE) -C usr SCST_INC_DIR=$(SCST_INC_DIR)
include/iscsi_scst_itf_ver.h: include/iscsi_scst.h

View File

@@ -1453,7 +1453,9 @@ struct scst_dev_type {
* be started. Can be used to close open file handlers, which might
* prevent the state switch.
*
* Called under scst_dg_mutex and no activities on the dev handler level.
* Called under scst_dg_mutex and no activities on the dev handler level
* (for implicit ALUA case supposed to be done by the user space via
* "block" sysfs attribute as described in the README).
*
* OPTIONAL
*/
@@ -1465,7 +1467,9 @@ struct scst_dev_type {
* be finished. Can be used to (re)open file handlers closed in
* on_alua_state_change_start().
*
* Called under scst_dg_mutex and no activities on the dev handler level.
* Called under scst_dg_mutex and no activities on the dev handler level
* (for implicit ALUA case supposed to be done by the user space via
* "block" sysfs attribute as described in the README).
*
* OPTIONAL
*/

View File

@@ -3533,9 +3533,23 @@ out_put:
static int dev_user_unregister_dev(struct file *file)
{
struct scst_user_dev *dev;
int res;
dev = file->private_data;
res = dev_user_check_reg(dev);
if (unlikely(res != 0))
goto out;
PRINT_WARNING("SCST_USER_UNREGISTER_DEVICE is obsolete and NOOP. "
"Closing fd should be used instead.");
return 0;
/* For backward compatibility unblock possibly blocked sync threads */
dev->blocking = 0;
wake_up_all(&dev->udev_cmd_threads.cmd_list_waitQ);
out:
return res;
}
static int dev_user_flush_cache(struct file *file)

View File

@@ -145,6 +145,13 @@ static struct scst_trace_log vdisk_local_trace_tbl[] = {
struct scst_vdisk_dev {
uint64_t nblocks;
/*
* Not protected, because assignments to aligned 64-bit integers are
* atomic. At worst, accesses to it should be covered by ACCESS_ONCE(),
* but not sure if that is really needed, so would prefer to keep it
* away from the fast path.
*/
loff_t file_size; /* in bytes */
/*

View File

@@ -2535,9 +2535,13 @@ static int scst_cm_dev_register(struct scst_device *dev, uint64_t lun)
list_for_each_entry(tgt_dev, head, sess_tgt_dev_list_entry) {
if (tgt_dev->dev == dev) {
PRINT_ERROR("Copy Manager already registered "
/*
* It's OK, because the copy manager could
* auto register some devices
*/
TRACE_DBG("Copy Manager already registered "
"device %s", dev->virt_name);
res = -EEXIST;
res = 0;
goto out;
}
}

View File

@@ -4597,7 +4597,7 @@ out:
return res;
}
/* Either add or replace a LUN. */
/* Either add or replace a LUN according to flags argument */
int scst_acg_repl_lun(struct scst_acg *acg, struct kobject *parent,
struct scst_device *dev, uint64_t lun,
unsigned int flags)

View File

@@ -954,7 +954,8 @@ out_fail:
* group @tg->dg.
*/
static void __scst_tg_set_state(struct scst_target_group *tg,
enum scst_tg_state state)
enum scst_tg_state state,
bool call_on_alua_state_change)
{
struct scst_dg_dev *dg_dev;
struct scst_device *dev;
@@ -1018,7 +1019,7 @@ int scst_tg_set_state(struct scst_target_group *tg, enum scst_tg_state state)
if (res)
goto out;
__scst_tg_set_state(tg, state);
__scst_tg_set_state(tg, state, true);
mutex_unlock(&scst_dg_mutex);
out:
@@ -1325,7 +1326,7 @@ static void __scst_dg_remove(struct scst_dev_group *dg)
list_del(&dg->entry);
scst_dg_sysfs_del(dg);
list_for_each_entry(tg, &dg->tg_list, entry)
__scst_tg_set_state(tg, SCST_TG_STATE_OPTIMIZED);
__scst_tg_set_state(tg, SCST_TG_STATE_OPTIMIZED, false);
while (!list_empty(&dg->dev_list)) {
dgdev = list_first_entry(&dg->dev_list, struct scst_dg_dev,
entry);

View File

@@ -1499,6 +1499,7 @@ sub serializeNkAttr {
|| defined($attr_filter)
&& defined($$attr_filter{$attribute}))
&& !defined($$attributes{$attribute}->{'keys'})
&& $attribute ne 'dif_checks_failed'
&& $attribute ne 'enabled'
&& $attribute ne 'hw_target') {
my $value = $$attributes{$attribute}->{'value'};

View File

@@ -1,5 +1,5 @@
#
# SCSI target mid-level makefile
# Fileio_tgt user space dev handler make file
#
# Copyright (C) 2007 - 2016 Vladislav Bolkhovitin <vst@vlnb.net>
# Copyright (C) 2007 - 2016 SanDisk Corporation