Commit Graph

125 Commits

Author SHA1 Message Date
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
Vladislav Bolkhovitin
eafe13657f Hide disabled targets from SendTargets view
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2074 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-09 14:53:42 +00:00
Vladislav Bolkhovitin
48bc41083c Patch from Dirk Meister <dmeister@uni-paderborn.de> fixing fprintf parameters
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1949 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-13 18:15:31 +00:00
Vladislav Bolkhovitin
7fe6c4e1af Fix 2 problems noticed by Chandra Seetharaman <sekharan@us.ibm.com>:
1.  isns_get_ip() getnameinfo error Temporary failure in name resolution!
2. isns_handle() unknown function 8006 4 4c00 6 0



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1890 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-29 11:37:44 +00:00
Vladislav Bolkhovitin
492e33a312 - Move nl_open() after kernel_open() to avoid issues when second start could skrew netlink states for the first instance
- Avoid compiler warn_unused_result warning



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1837 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 16:44:22 +00:00
Vladislav Bolkhovitin
a91af4e5d0 Cleanup inspired by IET r369
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1836 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 16:27:06 +00:00
Vladislav Bolkhovitin
1e7ca7a0b7 Merge of IET r341: New md5/sha1 code in ietd didn't handle the byte swap properly
for the digest counters on big endian systems.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1835 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 16:02:30 +00:00
Vladislav Bolkhovitin
43cfabc3cc Partial merge of IET r358 and 367: a bunch of iSNS fixes.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1834 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 15:57:49 +00:00
Vladislav Bolkhovitin
3c411a5ba7 Fix for bug reported by Mark Buechler <mark.buechler@gmail.com> when wrong wildcard attribute can be deleted
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-09 19:05:55 +00:00
Vladislav Bolkhovitin
13dea2fd6a - Fix possible buffer overflow in the iSNS code.
- Cleanups.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1793 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-28 18:03:10 +00:00
Vladislav Bolkhovitin
9f5938cccc It's better to perform target redirection only for allowed initiators.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1784 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-24 18:58:25 +00:00
Vladislav Bolkhovitin
ec3640be0b Partially merge of IET r307: allows to redirect initiators to another portals
+
Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-03 19:17:52 +00:00
Vladislav Bolkhovitin
459f589b34 - Delivery error response (instead of dropping connection) fixed
- Race when target deleted before the session(s) removal event(s) processed fixed
 - Docs updated



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1733 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-01 18:28:41 +00:00
Vladislav Bolkhovitin
5406a07d26 Various iSCSI initiators access control and visibility improvements. Particularly:
- SendTargets now returns all (allowed) portals. Particularly based on IET r230, 234, 249 and 264.
 - Initiators assigned to security groups without LUNs will not see the target during discovery and forbidden to login to it
 - Per portals access control added
 - Negative sign added to wildcard matching
 - Docs updated
 - Cleanups and minor fixes



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1685 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-07 18:08:52 +00:00
Vladislav Bolkhovitin
6b10382d1f Patch from Bart Van Assche <bvanassche@acm.org> fixing broken compilation on some systems
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1676 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-04 10:56:31 +00:00
Bart Van Assche
c99bd720c8 Removed trailing whitespace because checkpatch complained about it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1671 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-30 10:49:28 +00:00
Vladislav Bolkhovitin
1c21b1ffb8 Minor cleanups, fixes and updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1657 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-27 16:29:58 +00:00
Vladislav Bolkhovitin
c1a13ebaf4 Forgotten new files for r1651
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1652 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-23 17:50:01 +00:00
Vladislav Bolkhovitin
49e1187137 Merge of IET r326: OpenSSL dependency removal by utilizing the md5/sha1
code from the current kernel version.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1651 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-23 11:31:15 +00:00
Vladislav Bolkhovitin
7d218fb344 States cleanup and fix related login problem
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1650 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-23 11:26:39 +00:00
Vladislav Bolkhovitin
8404310cda IET r325: Minor fix-up for ietadm operations.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1648 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-23 10:42:10 +00:00
Vladislav Bolkhovitin
7cdcc6e43a Merge with IET r277: Fix TTT for final PDU. For Text Response it must be ISCSI_RESERVED_TAG.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1646 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-21 22:28:38 +00:00
Vladislav Bolkhovitin
f025190b53 - Loosly merge of IET r271: fix connection and session leak on connection preparation stages
- Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1645 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-21 22:17:43 +00:00
Vladislav Bolkhovitin
1b861ae336 - Merge of IET r255: cleanup copy & pasted code
- Docs update



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1643 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-21 18:32:35 +00:00
Vladislav Bolkhovitin
1848b1b15b Merge of IET r240: Fix use of uninitialised data in nl_write()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1642 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-21 18:03:08 +00:00