From eaed144f79a15bc47db9466755851a59786b11b6 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 6 Nov 2009 19:28:27 +0000 Subject: [PATCH] Fix for user space part of the iSCSI target, which refused connections in the procfs mode. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1326 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/Makefile | 7 +++++++ iscsi-scst/include/iscsi_scst_ver.h | 10 +++++++++- iscsi-scst/usr/target.c | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 2a7d31fe4..eb5e27099 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -15,6 +15,7 @@ SBINDIR := /usr/local/sbin INITDIR := /etc/init.d RCDIR := /etc/rc.d KMOD := $(shell pwd)/kernel +INCDIR := $(shell pwd)/include ifeq ($(KVER),) ifeq ($(KDIR),) @@ -120,7 +121,13 @@ perf2debug: rm $(KMOD)/Makefile.aa disable_proc: + sed -i.aa s/"^#define CONFIG_SCST_PROC"/"\/* #define CONFIG_SCST_PROC *\/"/ $(INCDIR)/iscsi_scst_ver.h + @cmp $(INCDIR)/iscsi_scst_ver.h $(INCDIR)/iscsi_scst_ver.h.aa >/dev/null; if [[ $$? = 0 ]]; then rm $(INCDIR)/iscsi_scst_ver.h.aa; echo "sed failed"; false; fi + rm $(INCDIR)/iscsi_scst_ver.h.aa enable_proc: + sed -i.aa s/"\/\* #define CONFIG_SCST_PROC \*\/"/"#define CONFIG_SCST_PROC"/ $(INCDIR)/iscsi_scst_ver.h + @cmp $(INCDIR)/iscsi_scst_ver.h $(INCDIR)/iscsi_scst_ver.h.aa >/dev/null; if [[ $$? = 0 ]]; then rm $(INCDIR)/iscsi_scst_ver.h.aa; echo "sed failed"; false; fi + rm $(INCDIR)/iscsi_scst_ver.h.aa .PHONY: all mods progs install clean extraclean debug2release release2debug debug2perf perf2debug disable_proc enable_proc diff --git a/iscsi-scst/include/iscsi_scst_ver.h b/iscsi-scst/include/iscsi_scst_ver.h index a00cef891..fd3f8a19e 100644 --- a/iscsi-scst/include/iscsi_scst_ver.h +++ b/iscsi-scst/include/iscsi_scst_ver.h @@ -13,4 +13,12 @@ * GNU General Public License for more details. */ -#define ISCSI_VERSION_STRING "1.0.2/0.4.17r214" +#define CONFIG_SCST_PROC + +#ifdef CONFIG_SCST_PROC +#define ISCSI_VERSION_STRING_SUFFIX "-procfs" +#else +#define ISCSI_VERSION_STRING_SUFFIX +#endif + +#define ISCSI_VERSION_STRING "1.0.2/0.4.17r214" ISCSI_VERSION_STRING_SUFFIX diff --git a/iscsi-scst/usr/target.c b/iscsi-scst/usr/target.c index 095993488..6a3bba3ff 100644 --- a/iscsi-scst/usr/target.c +++ b/iscsi-scst/usr/target.c @@ -155,6 +155,9 @@ int target_add(u32 *tid, char *name) INIT_LIST_HEAD(&target->sessions_list); INIT_LIST_HEAD(&target->isns_head); target->tid = *tid; +#ifdef CONFIG_SCST_PROC + target->tgt_enabled = 1; +#endif insque(&target->tlist, &targets_list); isns_target_register(name);