Commit Graph

149 Commits

Author SHA1 Message Date
Bart Van Assche
bd16fd94de iscsid: Logically and negative conditions instead of or-ing these
Logically and negative allowed_portal conditions instead of
or-ing these. If both positive and negative conditions match,
the negative condition takes precedence.

This was proposed by Sergej Roytman <spocks.goatee@gmail.com>.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-24 09:03:04 +02:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Bart Van Assche
d9c1ffa29a iscsi-scst/usr/Makefile: Fix include path
Use the SCST_INC_DIR variable passed by the parent Makefile such that
both the in-tree and out-of-tree builds work.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6130 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-24 14:10:54 +00:00
Vladislav Bolkhovitin
c833137130 iscsi-scst: Suppress a compiler warning
Avoid that the following compiler warning is reported when compiling
iscsi-scst:

chap.c: In function 'chap_rand':
chap.c:348:5: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
     (void)read(fd, &r, sizeof(r));
     ^

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5614 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:02:00 +00:00
Vladislav Bolkhovitin
6dab45204c scst: Leave out FSF mail address
This avoids that the following checkpatch complaint is triggered:

Do not include the paragraph about writing to the Free Software Foundation's
mailing address from the sample GPL notice. The FSF has changed addresses in
the past, and may do so again. Linux already includes a copy of the GPL.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:24:03 +00:00
Vladislav Bolkhovitin
00851a7501 Merge of adding iSER web page and copyright updates from the iSER branch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Vladislav Bolkhovitin
e329cc5abb Make SCST patters matching, for instance, to match initiator names to their group names, case insensitive
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4981 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-28 22:47:21 +00:00
Bart Van Assche
75f9be4b34 iscsi-scst: Spelling fix - change dublicate into duplicate
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4926 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-29 10:43:00 +00:00
Vladislav Bolkhovitin
40e8a76637 Add possibility to specify local compilation flags
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4841 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-04-23 03:21:39 +00:00
Vladislav Bolkhovitin
369863f015 Allow install SCST in any location
Currently the install location of SCST is pretty much hard coded into 
the Makefiles to be /usr/local.

I am custom building a system for ZFS & SCST and I want to install in 
/usr instead of /usr/local.

Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.

This patch fixes it.

From Sietse van Zanen <sietse@wizdom.nu>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-08 21:25:45 +00:00
Vladislav Bolkhovitin
10ca1d2f20 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-20 02:05:29 +00:00
Vladislav Bolkhovitin
0252d5f9c9 Limit FirstBurstLength to improve TASK QUEUE FULL handling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4764 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-19 01:17:33 +00:00
Vladislav Bolkhovitin
ae6485796d Targets should be deleted after all its sessions deleted
Each session on delete is looking for each target.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4726 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-09 01:38:05 +00:00
Bart Van Assche
b74ed85a0c iscsi-scst: Fix recently introduced compiler warnings
Fix the following two compiler warnings:

chap.c: In function 'chap_rand':
chap.c:347:5: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
chap.c:348:5: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4623 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-18 14:27:50 +00:00
Vladislav Bolkhovitin
b238320767 target_del(): don't exit on existing sessions
Target_del() might has not yet received all connections close events, so
it can still has alive sessions. Wait for them to disappear.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4617 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-13 20:55:51 +00:00
Vladislav Bolkhovitin
54ffcc75c8 Fix incorrect check for TSIH wrap around
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4606 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-07 22:03:07 +00:00
Vladislav Bolkhovitin
7ecc784143 Add forgotten list_del() on session creation error path
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-03 02:08:40 +00:00
Vladislav Bolkhovitin
5cdfbd1817 Make CHAP random number generator stronger
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-03 02:03:15 +00:00
Vladislav Bolkhovitin
73c992f7dd Convert sizeof expr into sizeof(expr)
Avoids that the checkpatch tool included in kernel 3.6 emits the
following warning:

WARNING: sizeof *attr should be sizeof(*attr)

This patch has been generated by running the following command over
the SCST source tree and by reviewing these changes manually:

find -name '*.[ch]' |
  xargs -d\\n sed -i.tmp -e 's/sizeof  *\([^(][^(),; ]*\)/sizeof(\1)/g'

From: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-10 02:55:31 +00:00
Vladislav Bolkhovitin
57d7bcd809 Fix 2 bugs in iscsi_attr_replace() sent by Lev Vainblat <lev@zadarastorage.com>:
1. After attr was found in the attrs_list, it is inserted again back into the same list. As a result the list becomes corrupted.

The bug can be reproduced for example by the following sequence:

    $ echo add_attribute IncomingUser user secret111111 > /sys/kernel/scst_tgt/targets/iscsi/mgmt
    $ echo user secret222222 > /sys/kernel/scst_tgt/targets/iscsi/IncomingUser
    $ echo del_attribute IncomingUser user > /sys/kernel/scst_tgt/targets/iscsi/mgmt
    $ iscsiadm -m discovery -t st -p 127.0.0.1

Discovery fails and in syslog there is a message

    Oct  2 18:58:37 vsa-00000611 iscsi-scstd: [1059] cmnd_exec_login:940: ERROR: Authentication of initiator iqn.2011-04.com.zadarastorage:1553:vc-0 failed

2. Small memory leak in error recovery path.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4545 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-04 18:34:25 +00:00
Vladislav Bolkhovitin
7b77e66b07 Workaround (leftover?) events after disable iSNS server
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-24 18:54:35 +00:00
Vladislav Bolkhovitin
5221238b13 Fix strtoul() overflow handling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4318 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-23 21:41:45 +00:00
Vladislav Bolkhovitin
d3b4b46223 Patch improving handling of errors during passing connection to the kernel.
From Lev Vainblat <lev@zadarastorage.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4295 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-11 01:20:26 +00:00
Vladislav Bolkhovitin
eb95049061 Copyrights updated + cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-18 02:26:39 +00:00
Vladislav Bolkhovitin
7a87bf25a6 Cleanup + implement conditional logging
This patch:
* fixes signatures for log_debug and log_pdu macros
* collapses __log_<LEVEL> functions into one
* adds conditional logging

Here conditional logging means that the logging priority and logging level may
vary depending on some dynamic parameters. This is helpful when software is
able to recover from errors which occur periodically and hence, there is no
need to pollute system logs with tons of repetitive non-critical lines.

The following macros are added to support this feature:
* log_info_cond
* log_warning_cond
* log_error_cond

They take an additional first parameter called "level". If it is 0 then they
act as their non-cond counterparts, otherwise they act like log_debug with the
specified level.

Those who are not interested in conditional logging are not affected: they can
continue using plain old logging macros without any changes.

Signed-off-by: Sergey Myasnikov <tigra564@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4161 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-12 22:31:13 +00:00
Vladislav Bolkhovitin
5c2cde6757 Cleanup: move misc routines in misc.c
This patch moves the following utility functions from iscsi_scstd.c to misc.c
and makes them public (i.e. non-static):
* set_non_blocking
* sock_set_keepalive

Signed-off-by: Sergey Myasnikov <tigra564@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4160 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-12 21:52:35 +00:00
Bart Van Assche
85b89521f8 iscsi-scstd: Make really sure that the buffer allocated for nl_read() is large enough
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-04 16:39:26 +00:00
Bart Van Assche
fdeea7c916 iscsi-scstd: Follow-up for r4077 - avoid that reading from the netlink socket can cause data corruption
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-02-04 12:39:26 +00:00
Vladislav Bolkhovitin
9da517bae1 Update for kernel 3.2. Netlink part in iSCSI-SCST done by Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-18 23:48:02 +00:00
Vladislav Bolkhovitin
94418431ce Patch from Abhilash Sankar <Abhilash.S@hcl.com> with some fixes
Issue:
------------
The DevRegAttribute is sending a different Source Attribute (ISCSI name) which
represents the Storage Node for each target. So Microsoft isns server considers
the last request as the storage node and doesn't discover the previous targets.

Root Cause
----------------
Function ISNS_FUNC_DEV_ATTR_REG

Target A
Source attribute
            ISCSI-Name = <IQN A Name>
Operating Attribute
            ISCSI-Name  = <IQN A Name>
Flags
Replace Access = 1

Target B
Source attribute
               ISCSI-Name = <IQN B Name>
Operating Attribute
               ISCSI-Name  = <IQN B Name>
Replace Access = 1

So as per the request format Microsoft isns Server always takes the last target
as the source node. and register the same. Hence it doesn't discover the
targets other than last one. The Source Attribute has to be fixed for all targets. It
would be better if we use the first target iscsi name (rather than the last target
iscsi name) as source attribute iscsi name to represent the storage node.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3863 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-09-18 00:58:15 +00:00
Vladislav Bolkhovitin
5ff5d0e667 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3601 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-20 20:09:04 +00:00
Vladislav Bolkhovitin
8b90327419 Modified patch from Bart Van Assche <bvanassche@acm.org> fixing errors reporting
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3552 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-07 18:08:58 +00:00
Vladislav Bolkhovitin
8cfb816e16 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-06-03 20:29:48 +00:00
Vladislav Bolkhovitin
0c6cf4100d iSNS server should know only about enabled targets
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3424 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-29 18:21:30 +00:00
Vladislav Bolkhovitin
c5b9c85591 - More timers improvements
- Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3421 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-26 19:07:13 +00:00
Vladislav Bolkhovitin
64065a21e9 NOP-In/response timeouts improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3411 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-25 23:50:49 +00:00
Vladislav Bolkhovitin
ba711072a4 Minor cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3354 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-04 18:13:27 +00:00
Vladislav Bolkhovitin
aa72d67856 Patch from Stefan Hauser <st.hauser@googlemail.com> with some style changes fixing case when after a error
between sessions_count increment and the corresponding session creation, sessions_count is not decremented.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3353 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-04 17:58:59 +00:00
Bart Van Assche
d1acc24bed Suppress gcc 4.6 warnings about unused variables.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-03 14:34:48 +00:00
Vladislav Bolkhovitin
1d717b0441 DefaultTime2Retain and DefaultTime2Wait should always be negotiated to 0 since not supported.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-21 12:03:31 +00:00
Vladislav Bolkhovitin
f518cd150c Let's remove *.orig and *.rej files on extraclean
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3277 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-10 20:07:23 +00:00
Vladislav Bolkhovitin
2a230b19ee Errors reporting cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3245 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-02-09 22:48:24 +00:00
Vladislav Bolkhovitin
f3238333dd Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3200 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-01-06 20:02:04 +00:00
Bart Van Assche
dd44ac462a Corrected feedback e-mail address.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3113 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-12-16 16:23:35 +00:00
Bart Van Assche
93e5e30c62 Corrected feedback e-mail address.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3112 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-12-16 16:22:25 +00:00
Vladislav Bolkhovitin
e24296ad98 Fix case when after INCOMING_MAX overflow no listen events requested to be provided by poll().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3088 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-12-15 15:48:51 +00:00
Vladislav Bolkhovitin
e32b9a721e Fixes 2 iSNS server initialization problems noticed by Tan Eric <Eric.Tan@bdt-cn.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2373 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-08 18:10:12 +00:00
Vladislav Bolkhovitin
013f6f1abe Possible buffer overflow in the config load code fixed. Thanks to wk <witold.kowolik@open-e.com> to pointing on it!
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2297 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-28 15:07:17 +00:00
Bart Van Assche
8c0c079be4 Fixed a compiler warning.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2107 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-12 17:44:11 +00:00
Bart Van Assche
5b33692678 More upstream include path conversions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-09 15:27:54 +00:00