Re: [PATCH 2/2] iscsi_tcp: disallow binding the same connection twice

2024-03-19 Thread Mike Christie
On 3/18/24 2:49 PM, Khazhismel Kumykov wrote: > iscsi_sw_tcp_conn_bind does not check or cleanup previously bound > sockets, nor should we allow binding the same connection twice. > This looks like a problem for all the iscsi drivers. I think you could: 1. Add a check for ISCSI_CONN_FLAG_BOUND

Re: [PATCH 1/2] iscsi_tcp: do not bind sockets that already have extra callbacks

2024-03-19 Thread Mike Christie
scsi_cls_session > *cls_session, > } > > err = -EINVAL; > - if (!sk_is_tcp(sock->sk)) > + if (!sk_is_tcp(sock->sk) || sock->sk->sk_user_data) > goto free_socket; > > err = iscsi_conn_bind(cls_session, cls_conn, is_leading); Revie

Re: [PATCH] scsi: iscsi: fix iscsi ida memory leak

2024-01-29 Thread Mike Christie
On 1/29/24 3:04 AM, Guixin Liu wrote: > The iscsi_sess_ida should be destroy when the iscsi module exit. > > Signed-off-by: Guixin Liu > --- > drivers/scsi/scsi_transport_iscsi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/scsi/scsi_transport_iscsi.c >

Re: [PATCH] scsi: iscsi_tcp: restrict to TCP sockets

2023-09-15 Thread Mike Christie
On 9/15/23 12:11 PM, Eric Dumazet wrote: > Nothing prevents iscsi_sw_tcp_conn_bind() to receive file descriptor > pointing to non TCP socket (af_unix for example). > > Return -EINVAL if this is attempted, instead of crashing the kernel. > Reviewed-by: Mike Christie -

Re: [PATCH v2] scsi: iscsi: kfree_sensitive() in iscsi_session_free()

2023-07-23 Thread Mike Christie
gt;username_in); > kfree(session->targetname); > kfree(session->targetalias); > kfree(session->initiatorname); Reviewed-by: Mike Christie -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe fro

Re: [PATCH v1] scsi: iscsi: use kfree_sensitive() in iscsi_session_free()

2023-07-17 Thread Mike Christie
On 7/17/23 4:26 AM, Minjie Du wrote: > session might contain private part of the password, so better use > kfree_sensitive() to free it. > In iscsi_session_free() use kfree_sensitive() to free session->password. > > Signed-off-by: Minjie Du > --- > drivers/scsi/libiscsi.c | 2 +- > 1 file

Re: [PATCH net-next v4 11/15] iscsi: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage

2023-06-23 Thread Mike Christie
ages it's going to transfer plus two for the header and > trailer and page fragments to hold the header and trailer - and then call > sendmsg once for the entire message. > > Signed-off-by: David Howells > cc: Lee Duncan > cc: Chris Leech > cc: Mike Christie > cc: Maurizio Lomba

Re: [PATCH 05/11] iscsi: check net namespace for all iscsi lookup

2023-05-12 Thread Mike Christie
On 5/6/23 6:29 PM, Chris Leech wrote: > @@ -4065,8 +4108,10 @@ iscsi_if_recv_msg(struct net *net, struct sk_buff *skb, > ev->u.c_session.cmds_max, > ev->u.c_session.queue_depth); > break; > +

Re: [PATCH] scsi: iscsi_tcp: Check the sock is correct before iscsi_set_param

2023-03-29 Thread Mike Christie
this change. This change may lead to inconsistent values of > tcp_sw_conn->sendpage and conn->datadgst_en. > > Fix it by moving the position of the assignment. > > Fixes: 57569c37f0ad ("scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while > calling getpeername()")

Re: [PATCH 1/2] scsi:core:Add sysfs interface to control if skip lun with PQ=1

2022-12-18 Thread Mike Christie
On 12/14/22 1:08 AM, Wenchao Hao wrote: > > When iSCSI initiator logged in target, the target attached none valid > lun but lun0. lun0 is not an valid disk, while it would response > inquiry command with PQ=1 and other general scsi commands like probe lun. > The others luns of target is

Re: [PATCH] scsi: iscsi_tcp: Fix UAF when access shost attr during session logout

2022-12-12 Thread Mike Christie
On 12/11/22 8:32 AM, Wenchao Hao wrote: > On Sun, Dec 11, 2022 at 6:07 AM Mike Christie > wrote: >> >> On 12/9/22 2:22 AM, Ding Hui wrote: >>> During iscsi session logout, if another task accessing shost ipaddress >>> attr at this time

Re: [PATCH] scsi: iscsi_tcp: Fix UAF when access shost attr during session logout

2022-12-10 Thread Mike Christie
On 12/9/22 2:22 AM, Ding Hui wrote: > During iscsi session logout, if another task accessing shost ipaddress > attr at this time, we can get a KASAN UAF report like this: > > [ 276.941685] > == > [ 276.942144] BUG: KASAN:

Re: [PATCH v7] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace

2022-12-07 Thread Mike Christie
ld > sync this session and scan this session when iscsid restarted. > > V4: > - Move debug print out of spinlock critical section > > V3: > - Make target bind state to a state kind rather than a bool. > > V2: > - Using target_unbound rather than state to indicate ses

Re: [PATCH] scsi:iscsi: Record session's startup mode in kernel

2022-11-30 Thread Mike Christie
On 11/30/22 5:05 PM, Lee Duncan wrote: > On 11/30/22 12:08, Mike Christie wrote: >> On 11/30/22 1:53 PM, Lee Duncan wrote: >>> Have you already worked on the open-iscsi side of this? No reason for >>> duplicate development. >> >> I think you misse

Re: [PATCH] scsi:iscsi: Record session's startup mode in kernel

2022-11-30 Thread Mike Christie
On 11/30/22 1:53 PM, Lee Duncan wrote: > Have you already worked on the open-iscsi side of this? No reason for > duplicate development. I think you missed his reply where he said he was missed the iscsid.safe_logout setting. -- You received this message because you are subscribed to the

Re: [PATCH] scsi:iscsi: Record session's startup mode in kernel

2022-11-23 Thread Mike Christie
On 11/22/22 10:41 PM, Wenchao Hao wrote: > Sorry I did not highlight the key points. The root reason we need to record > node_startup mode in kernel is userspace's node_startup mode is unreliable in > some scenarios: > > 1. iscsi node and session is created in initrd, the configure files of these

Re: [PATCH v6] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace

2022-11-22 Thread Mike Christie
On 11/22/22 11:29 AM, Wenchao Hao wrote: > On Wed, Nov 23, 2022 at 1:04 AM Mike Christie > wrote: >> >> On 11/21/22 8:17 AM, Wenchao Hao wrote: >>> And the function looks like following after change: >>> >>> static void __iscsi_unbind_session(str

Re: [PATCH] scsi:iscsi: Record session's startup mode in kernel

2022-11-22 Thread Mike Christie
On 11/22/22 3:30 PM, Wenchao Hao wrote: > There are 3 iscsi session's startup mode which are onboot, manual and > automatic. We can boot from iSCSI disks with help of dracut's service > in initrd, which would set node's startup mode to onboot, then create > iSCSI sessions. > > While the configure

Re: [PATCH] scsi:iscsi: rename iscsi_set_param to iscsi_if_set_param

2022-11-22 Thread Mike Christie
err = -EINVAL; > break; > case ISCSI_UEVENT_SET_PARAM: > - err = iscsi_set_param(transport, ev); > + err = iscsi_if_set_param(transport, ev); > break; > case ISCSI_UEVENT_CREATE_CONN: > case ISCSI

Re: [PATCH v6] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace

2022-11-22 Thread Mike Christie
On 11/21/22 8:17 AM, Wenchao Hao wrote: > And the function looks like following after change: > > static void __iscsi_unbind_session(struct work_struct *work) > { > struct iscsi_cls_session *session = > container_of(work, struct iscsi_cls_session, >

Re: [PATCH v2] scsi: iscsi: fix possible memory leak when device_register failed

2022-11-10 Thread Mike Christie
calling put_device(), the name will be freed in the > kobject_cleanup(), and this patch modified resources will be > released by calling the corresponding callback function in the > device_release(). > > Signed-off-by: Zhou Guanghui > Thanks. Reviewed-by: Mike Christie -- Y

Re: [-next] scsi: iscsi: fix possible memory leak in iscsi_register_transport

2022-11-09 Thread Mike Christie
; if (err) > @@ -4850,8 +4850,8 @@ iscsi_register_transport(struct iscsi_transport *tt) > unregister_dev: > device_unregister(>dev); > return NULL; > -free_priv: > - kfree(priv); > +put_dev: > + put_device(>dev); > return NULL; > } > EXPOR

Re: [PATCH] scsi: iscsi: fix possible memory leak when transport_register_device() fails

2022-11-09 Thread Mike Christie
On 11/9/22 3:24 AM, Yang Yingliang wrote: > If transport_register_device() fails, transport_destroy_device() should > be called to release the memory allocated in transport_setup_device(). > > Fixes: 0896b7523026 ("[SCSI] open-iscsi/linux-iscsi-5 Initiator: Transport > class update for iSCSI") >

Re: [PATCH v6] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace

2022-11-08 Thread Mike Christie
On 11/7/22 7:44 PM, Wenchao Hao wrote: > I found an issue that kernel would send ISCSI_KEVENT_UNBIND_SESSION > for multiple times which should be fixed. > > This patch introduce target_state in iscsi_cls_session to make > sure session would send only one ISCSI_KEVENT_UNBIND_SESSION. > > But this

Re: [PATCH] recovery: remove onlining of devices via sysfs

2022-08-29 Thread Mike Christie
could remove the session_online_devs call for newer kernels. The session_online_devs call was handling the case where a scsi cmd timesout because the network is lost, we run the scsi eh, that ends up getting escalated to us dropping the session, then iscsi_eh_session_reset fails due to the replaceme

Re: [PATCH v3] scsi: iscsi: Fix multiple iscsi session unbind event sent to userspace

2022-08-11 Thread Mike Christie
On 8/1/22 10:47 PM, Wenchao Hao wrote: > I found an issue that kernel would send ISCSI_KEVENT_UNBIND_SESSION > for multiple times which should be fixed. > > This patch introduce target_state in iscsi_cls_session to make > sure session would send only one ISCSI_KEVENT_UNBIND_SESSION. > > But this

Re: [PATCH] scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername()

2022-08-02 Thread Mike Christie
On 8/2/22 6:23 AM, lijinlin (A) wrote: > So sorry, this patch has problem, please ignore. > Was the issue the fget use? I know I gave the suggestion to do the get, but seeing it now makes me think I was wrong and it's getting too messy. Let's just add a mutex for getting/setting the

Re: [PATCH] scsi: iscsi: prefer xmit of DataOut before new cmd

2022-06-15 Thread Mike Christie
think a common solution is going to happen. You patch fixes the bug, and I've found a workaround for my issue where I tweak the queue depth, so I think we will be ok. Reviewed-by: Mike Christie -- You received this message because you are subscribed to the Google Groups "open-iscsi" gro

Re: [PATCH] scsi: iscsi: prefer xmit of DataOut before new cmd

2022-06-09 Thread Mike Christie
On 6/9/22 4:02 AM, Dmitriy Bogdanov wrote: > Hi Mike, > >>> On 6/8/22 9:16 AM, Dmitriy Bogdanov wrote: >>>> On 6/7/22 10:55 AM, Mike Christie wrote: >>>>> On 6/7/22 8:19 AM, Dmitry Bogdanov wrote: >>>>>> In function iscsi_data_xmit (TX w

Re: [PATCH] scsi: iscsi: prefer xmit of DataOut before new cmd

2022-06-08 Thread Mike Christie
On 6/8/22 9:16 AM, Dmitriy Bogdanov wrote: > Hi Mike, > >> On 6/7/22 10:55 AM, Mike Christie wrote: >>> On 6/7/22 8:19 AM, Dmitry Bogdanov wrote: >>>> In function iscsi_data_xmit (TX worker) there is walking through the >>>> queue of new SCSI comman

Re: [PATCH] scsi: iscsi: prefer xmit of DataOut before new cmd

2022-06-07 Thread Mike Christie
On 6/7/22 10:55 AM, Mike Christie wrote: > On 6/7/22 8:19 AM, Dmitry Bogdanov wrote: >> In function iscsi_data_xmit (TX worker) there is walking through the >> queue of new SCSI commands that is replenished in parallell. And only >> after that queue got emptied the functi

Re: [PATCH] scsi: iscsi: prefer xmit of DataOut before new cmd

2022-06-07 Thread Mike Christie
On 6/7/22 8:19 AM, Dmitry Bogdanov wrote: > In function iscsi_data_xmit (TX worker) there is walking through the > queue of new SCSI commands that is replenished in parallell. And only > after that queue got emptied the function will start sending pending > DataOut PDUs. That lead to DataOut timer

Re: [bug report] scsi: iscsi: Remove iscsi_get_task back_lock requirement

2022-05-23 Thread Mike Christie
On 5/23/22 1:58 AM, Dan Carpenter wrote: > Hello Mike Christie, > > The patch a01ff1e161ea: "scsi: iscsi: Remove iscsi_get_task back_lock > requirement" from May 18, 2022, leads to the following Smatch static > checker warning: > > drivers/scsi/libis

Re: [PATCH] scsi: iscsi: fix harmless double shift bug

2022-04-21 Thread Mike Christie
SUSPEND_RX BIT(1) > -#define ISCSI_CONN_FLAG_BOUNDBIT(2) > +#define ISCSI_CONN_FLAG_SUSPEND_TX 0 > +#define ISCSI_CONN_FLAG_SUSPEND_RX 1 > +#define ISCSI_CONN_FLAG_BOUND2 > > #define ISCSI_ITT_MASK 0x1fff > #de

Re: [PATCH v2] scsi: iscsi: Fix multiple iscsi session unbind event sent to userspace

2022-04-20 Thread Mike Christie
On 4/17/22 7:06 PM, Wenchao Hao wrote: > I found an issue that kernel would send ISCSI_KEVENT_UNBIND_SESSION > for multiple times which should be fixed. > > This patch introduce target_unbound in iscsi_cls_session to make > sure session would send only one ISCSI_KEVENT_UNBIND_SESSION. > > But

Re: [PATCH 2/2] iscsi: set session to FREE state after unbind session in remove session

2022-04-15 Thread Mike Christie
On 4/15/22 4:40 AM, Wenchao Hao wrote: > On 2022/4/14 23:30, Mike Christie wrote: >> On 4/13/22 8:49 PM, Wenchao Hao wrote: >>> __iscsi_unbind_session() set session state to ISCSI_SESSION_UNBOUND, which >>> would overwrite the ISCSI_SESSION_FREE state. >>

Re: [PATCH 2/2] iscsi: set session to FREE state after unbind session in remove session

2022-04-14 Thread Mike Christie
On 4/13/22 8:49 PM, Wenchao Hao wrote: > __iscsi_unbind_session() set session state to ISCSI_SESSION_UNBOUND, which > would overwrite the ISCSI_SESSION_FREE state. > > Signed-off-by: Wenchao Hao > --- > drivers/scsi/scsi_transport_iscsi.c | 26 -- > 1 file changed, 16

Re: [PATCH 1/2] scsi: iscsi: introduce session UNBOUND state to avoid multiple unbind event

2022-04-14 Thread Mike Christie
On 4/13/22 8:49 PM, Wenchao Hao wrote: > Fix the issue of kernel send multiple ISCSI_KEVENT_UNBIND_SESSION event. > If session is in UNBOUND state, do not perform unbind operations anymore, > else unbind session and set session to UNBOUND state. > I don't think we want this to be a state because

Re: [PATCH] scsi:libiscsi: remove unnecessary memset in iscsi_conn_setup

2022-03-17 Thread Mike Christie
5,6 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, > int dd_size, > if (!cls_conn) > return NULL; > conn = cls_conn->dd_data; > - memset(conn, 0, sizeof(*conn) + dd_size); > > conn->dd_data = cls_conn->dd_data + sizeof(

Re: [PATCH] scsi:libiscsi: remove unnecessary memset in iscsi_conn_setup

2022-03-16 Thread Mike Christie
On 3/16/22 4:02 AM, Wenchao Hao wrote: > cc open-iscsi@googlegroups.com linux-s...@vger.kernel.org > > On 2022/3/17 6:09, Wenchao Hao wrote: >> iscsi_cls_conn is alloced by kzalloc(), the whole iscsi_cls_conn is >> zero filled already including the dd_data. So it is unnecessary to >> call memset

Re: [PATCH v3 0/3] scsi:iscsi: handle iscsi_cls_conn device with sysfs correctly

2022-03-09 Thread Mike Christie
+-- > include/scsi/scsi_transport_iscsi.h | 5 +- > 3 files changed, 66 insertions(+), 52 deletions(-) > Nice. Thanks. Reviewed-by: Mike Christie -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To un

Re: [PATCH v2 3/3] scsi:libiscsi: teardown iscsi_cls_conn gracefully

2022-03-08 Thread Mike Christie
On 3/8/22 9:09 PM, Wenchao Hao wrote: > @@ -3143,8 +3145,6 @@ void iscsi_conn_teardown(struct iscsi_cls_conn > *cls_conn) > mutex_unlock(>eh_mutex); > > iscsi_destroy_conn(cls_conn); This should then be a iscsi_put_conn. So basically it balances out. iscsi_alloc_conn requires

Re: [PATCH v2 3/3] scsi:libiscsi: teardown iscsi_cls_conn gracefully

2022-03-08 Thread Mike Christie
On 3/8/22 9:09 PM, Wenchao Hao wrote: > diff --git a/drivers/scsi/scsi_transport_iscsi.c > b/drivers/scsi/scsi_transport_iscsi.c > index ca724eed4f4d..7b4d998708e7 100644 > --- a/drivers/scsi/scsi_transport_iscsi.c > +++ b/drivers/scsi/scsi_transport_iscsi.c > @@ -2165,6 +2165,7 @@ static int

Re: [PATCH v2 1/3] scsi: iscsi: Add helper functions to manage iscsi_cls_conn

2022-03-08 Thread Mike Christie
On 3/8/22 9:09 PM, Wenchao Hao wrote: > iscsi_alloc_conn(): alloc and initialize iscsi_cls_conn > iscsi_add_conn(): expose iscsi_cls_conn to userspace's via sysfs. > iscsi_remove_conn(): remove iscsi_cls_conn from sysfs > iscsi_free_conn(): free iscsi_cls_conn > > Signed-off-by: Wenchao Hao >

Re: [PATCH 0/2]scsi:libiscsi: Add iscsi_cls_conn device to sysfs correctly

2022-03-07 Thread Mike Christie
On 3/7/22 6:56 PM, Wenchao Hao wrote: > We found a NULL pointer dereference in iscsi_sw_tcp_conn_get_param(), > the root reason is we did sysfs addition wrong. > > iscsi_create_conn() expose iscsi_cls_conn to sysfs while the related > resources are not initialized. So we should delay the calling

Re: [PATCH 1/2] scsi: iscsi: Add helper functions to alloc and add iscsi_cls_conn

2022-03-07 Thread Mike Christie
On 3/7/22 6:56 PM, Wenchao Hao wrote: > iscsi_alloc_conn() would alloc and initialize iscsi_cls_conn but do > not expose it to userspace. > iscsi_add_conn() would expose it to userspace. > > LLDs should split the alloc and register to 2 steps. > > And simplify iscsi_create_conn() with these

Re: [PATCH 1/2] iscsi_tcp: Fix NULL pointer dereference in iscsi_sw_tcp_conn_get_param()

2022-03-03 Thread Mike Christie
On 3/3/22 8:56 PM, Wenchao Hao wrote: > kernel might crash in iscsi_sw_tcp_conn_get_param() because it dereference > an invalid address. > > The initialization of iscsi_conn's dd_data is after device_register() of > struct iscsi_cls_conn, so iscsi_conn's dd_data might not initialized when >

Re: [PATCH 2/2] iscsi_tcp: Check if tcp_conn is valid in

2022-03-03 Thread Mike Christie
On 3/3/22 8:56 PM, Wenchao Hao wrote: > iscsi_create_conn() would add newly alloced iscsi_cls_conn to connlist, > it means when userspace sends ISCSI_UEVENT_SET_PARAM, iscsi_conn_lookup() > would found this iscsi_cls_conn and call the set_param callback which is > iscsi_sw_tcp_conn_set_param().

Re: Question about iscsi session block

2022-02-26 Thread Mike Christie
On 2/15/22 8:19 PM, michael.chris...@oracle.com wrote: > On 2/15/22 7:28 PM, Zhengyuan Liu wrote: >> On Wed, Feb 16, 2022 at 12:31 AM Mike Christie >> wrote: >>> >>> On 2/15/22 9:49 AM, Zhengyuan Liu wrote: >>>> Hi, all >>>> >>>

Re: Question about iscsi session block

2022-02-15 Thread Mike Christie
On 2/15/22 9:49 AM, Zhengyuan Liu wrote: > Hi, all > > We have an online server which uses multipath + iscsi to attach storage > from Storage Server. There are two NICs on the server and for each it > carries about 20 iscsi sessions and for each session it includes about 50 > iscsi devices (yes,

Re: Antw: [EXT] Re: [PATCH] scsi scsi_transport_iscsi.c: fix misuse of %llu in scsi_transport_iscsi.c

2021-10-11 Thread Mike Christie
On 10/11/21 1:35 AM, Ulrich Windl wrote: Joe Perches schrieb am 09.10.2021 um 05:14 in Nachricht > <5daf69b365e23ceecee911c4d0f2f66a0b9ec95c.ca...@perches.com>: >> On Sat, 2021-10-09 at 11:02 +0800, Guo Zhi wrote: >>> Pointers should be printed with %p or %px rather than >>> cast to

Re: [PATCH v2] scsi: libiscsi: move init ehwait to iscsi_session_setup()

2021-09-13 Thread Mike Christie
ead(>ehwait); > > spin_lock_init(>frwd_lock); > spin_lock_init(>back_lock); > @@ -3074,8 +3075,6 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, > int dd_size, > goto login_task_data_alloc_fail; > conn->login_task->data = conn->

Re: [PATCH 2/3] scsi: libiscsi: fix invalid pointer dereference in iscsi_eh_session_reset

2021-09-10 Thread Mike Christie
On 9/9/21 8:02 PM, Ding Hui wrote: > like commit 5db6dd14b313 ("scsi: libiscsi: Fix NULL pointer dereference in > iscsi_eh_session_reset"), access conn->persistent_address here is not safe > too. > > The persistent_address is independent of conn refcount, so maybe > already freed by

Re: [PATCH 1/3] scsi: libiscsi: move init ehwait to iscsi_session_setup()

2021-09-10 Thread Mike Christie
On 9/9/21 8:02 PM, Ding Hui wrote: > commit ec29d0ac29be ("scsi: iscsi: Fix conn use after free during > resets") move member ehwait from conn to session, but left init ehwait > in iscsi_conn_setup(). > > Due to one session can be binded by multi conns, the conn after the A session can only have

Re: [PATCH 2/2] scsi: iscsi_tcp: Fix use-after-free in iscsi_sw_tcp_host_get_param()

2021-04-12 Thread Mike Christie
On 4/6/21 8:24 PM, Wenchao Hao wrote: > iscsi_sw_tcp_host_get_param() would access struct iscsi_session, while > struct iscsi_session might be freed by session destroy flow in > iscsi_free_session(). This commit fix this condition by freeing session > after host has already been removed. > >

Re: [PATCH AUTOSEL 5.10 07/22] scsi: iscsi: Fix race condition between login and sync thread

2021-04-06 Thread Mike Christie
gt; https://urldefense.com/v3/__https://lore.kernel.org/r/20210325093248.284678-1-gulam.mohamed@oracle.com__;!!GqivPVa7Brio!Jiqrc6pu3EgrquzpG-KpNQkNebwKUgctkE0MN1MloQ2y5Y4OVOkKN0yCr2_W_CX2oRet$ > > Reviewed-by: Mike Christie There was a mistake in my review of this patch. It will also req

Re: [PATCH] iscsi: Do Not set param when sock is NULL

2021-01-18 Thread Mike Christie
On 1/7/21 9:48 AM, Gulam Mohamed wrote: > Hi Michael, > > As per your suggestions in below mail, I have completed the > suggested changes and tested them. Can you please review and let me know your > comments? Here is the patch: > > Description > === > 1. This Kernel panic

Re: [RFC PATCH] scsi:libiscsi:Fix possible NULL dereference in iscsi_eh_cmd_timed_out

2020-12-14 Thread Mike Christie
On 12/14/20 2:41 AM, Wu Bo wrote: > When testing kernel 4.18 version, NULL pointer dereference problem occurs > in iscsi_eh_cmd_timed_out function. > > I think this bug in the upstream is still exists. > > The analysis reasons are as follows: > 1) For some reason, I/O command did not complete

Re: [PATCH] scsi: iscsi: fix inappropriate use of put_device

2020-12-02 Thread Mike Christie
> return conn; > > release_conn_ref: > - put_device(>dev); > + device_unregister(>dev); > + put_device(>dev); > + return NULL; > release_parent_ref: > put_device(>dev); > free_conn: > Reviewed-by: Mike Christie -- You received this m

Re: [PATCH v2] SCSI: libiscsi: fix NOP race condition

2020-11-11 Thread Mike Christie
(struct iscsi_task *)-1l + static inline int iscsi_task_has_unsol_data(struct iscsi_task *task) { return task->unsol_r2t.data_length > task->unsol_r2t.sent; Reviewed-by: Mike Christie -- You received this message because you are subscribed to the Google Groups "ope

Re: [PATCH] scsi: libiscsi: fix NOP race condition

2020-11-04 Thread Mike Christie
On 11/4/20 3:33 PM, Mike Christie wrote: On 9/18/20 4:09 PM, Lee Duncan wrote: From: Lee Duncan iSCSI NOPs are sometimes "lost", mistakenly sent to the user-land iscsid daemon instead of handled in the kernel, as they should be, resulting in a message from the daemon like: iscsi

Re: [PATCH] scsi: libiscsi: fix NOP race condition

2020-11-04 Thread Mike Christie
On 9/18/20 4:09 PM, Lee Duncan wrote: From: Lee Duncan iSCSI NOPs are sometimes "lost", mistakenly sent to the user-land iscsid daemon instead of handled in the kernel, as they should be, resulting in a message from the daemon like: iscsid: Got nop in, but kernel supports nop handling.

Re: [PATCH] scsi: libiscsi: Fix cmds hung when sd_shutdown

2020-10-31 Thread Mike Christie
On 10/31/20 3:23 AM, Wu Bo wrote: For some reason, during reboot the system, iscsi.service failed to logout all sessions. kernel will hang forever on its sd_sync_cache() logic, after issuing the SYNCHRONIZE_CACHE cmd to all still existent paths. [ 1044.098991] reboot: Mddev shutdown finished. [

Re: [PATCH v2 1/1] scsi: libiscsi: fix NOP race condition

2020-10-08 Thread Mike Christie
On 10/8/20 12:11 PM, Mike Christie wrote: > On 9/25/20 1:41 PM, ldun...@suse.com wrote: >> From: Lee Duncan >> >> iSCSI NOPs are sometimes "lost", mistakenly sent to the >> user-land iscsid daemon instead of handled in the kernel, >> as they should be,

Re: [PATCH v2 1/1] scsi: libiscsi: fix NOP race condition

2020-10-08 Thread Mike Christie
On 9/25/20 1:41 PM, ldun...@suse.com wrote: > From: Lee Duncan > > iSCSI NOPs are sometimes "lost", mistakenly sent to the > user-land iscsid daemon instead of handled in the kernel, > as they should be, resulting in a message from the daemon like: > >> iscsid: Got nop in, but kernel supports

Re: [PATCH] iscsi: iscsi_tcp: Avoid holding spinlock while calling getpeername

2020-09-29 Thread Mike Christie
(!tcp_sw_conn->sock) { > + sock = tcp_sw_conn->sock; > + if (!sock) { > spin_unlock_bh(>frwd_lock); > return -ENOTCONN; > } > + sock_hold(sock->sk); > + spin_unlock_bh(

Re: [PATCH] scsi: iscsi: Do not put host in iscsi_set_flashnode_param()

2020-07-25 Thread Mike Christie
_set_fnode; > } > > idx = ev->u.set_flashnode.flashnode_idx; > Reviewed-by: Mike Christie -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [PATCH] scsi: iscsi: register sysfs for workqueue iscsi_destroy

2020-07-03 Thread Mike Christie
S and drop __WQ_ORDERED_EXPLICIT since __WQ_ORDERED_EXPLICIT workqueue isn't allowed to change "cpumask". Suggested-by: Mike Christie Signed-off-by: Bob Liu --- drivers/scsi/scsi_transport_iscsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transpor

Re: [PATCH 2/2] scsi: register sysfs for scsi workqueue

2020-07-01 Thread Mike Christie
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, > 1, shost->host_no); > if (!shost->tmf_work_q) { > shost_printk(KERN_WARNING, shost, > Reviewed-by: Mike Christie -- You received this message because you are subscribed to the

Re: [PATCH 1/2] scsi: iscsi: change back iscsi workqueue max_active argu to 1

2020-07-01 Thread Mike Christie
;iscsi_eh"); > + 1, "iscsi_eh"); > if (!iscsi_eh_timer_workq) { > err = -ENOMEM; > goto release_nls; > Reviewed-by: Mike Christie I think it should get it into 5.8 to fix the bug I mentioned in the other threa

Re: [PATCH 2/2] scsi: register sysfs for scsi/iscsi workqueues

2020-06-29 Thread Mike Christie
On 6/11/20 5:07 AM, Bob Liu wrote: This patch enable setting cpu affinity through "cpumask" for below scsi/iscsi workqueues, so as to get better isolation. - scsi_wq_* - scsi_tmf_* - iscsi_q_xx - iscsi_eh Signed-off-by: Bob Liu --- drivers/scsi/hosts.c| 4 ++--

Re: [PATCH] iscsi: Perform connection failure entirely in kernel space

2019-12-10 Thread Mike Christie
On 12/10/2019 06:05 PM, Mike Christie wrote: > On 12/09/2019 12:20 PM, Gabriel Krisman Bertazi wrote: >> From: Bharath Ravi >> >> Connection failure processing depends on a daemon being present to (at >> least) stop the connection and start recovery. This is a problem

Re: [PATCH] iscsi: Perform connection failure entirely in kernel space

2019-12-10 Thread Mike Christie
On 12/09/2019 12:20 PM, Gabriel Krisman Bertazi wrote: > From: Bharath Ravi > > Connection failure processing depends on a daemon being present to (at > least) stop the connection and start recovery. This is a problem on a > multipath scenario, where if the daemon failed for whatever reason,

Re: RFC: A problem with stale session information?

2018-09-21 Thread Mike Christie
On 09/19/2018 12:39 PM, Lee Duncan wrote: > Hi All: > > I have been tracking down an issue that has to do with iSCSI sessions going > away. > > If an initiator and target have a session, then iscsid goes away (stops or > dies, without logging out of the session), and then the target goes away,

Re: max_sectors_kb so small, throughout so small

2018-09-20 Thread Mike Christie
least, max_data_area_mb>128 && hw_max_sectors>=4096, I can get a > better performance seems to be acceptable. > If my settings can give other users some help, I will be happy. > > 在 2018年9月12日星期三 UTC+8上午12:39:16,Mike Christie写道: > > On 09/11/

Re: max_sectors_kb so small, throughout so small

2018-09-11 Thread Mike Christie
On 09/11/2018 11:30 AM, Mike Christie wrote: > Hey, > > Cc mchri...@redhat.com, or I will not see these messages until I check > the list maybe once a week. > > On 09/05/2018 10:36 PM, 3kboy2...@gmail.com wrote: >> What lio fabric driver are you using? iS

Re: max_sectors_kb so small, throughout so small

2018-09-11 Thread Mike Christie
> > > > > > > > > > > > > Could you give me some suggestions about improving the > performance of > > /backstore/user:rbd/ device. > > > > Thanks very much! > > > > 在 201

Re: max_sectors_kb so small, throughout so small

2018-09-04 Thread Mike Christie
you for your informative response. > > > 在 2018年8月28日星期二 UTC+8上午8:49:46,Mike Christie写道: > > On 08/21/2018 08:52 PM, 3kbo...@gmail.com wrote: > > Hi folks, > > > > I am newbie to open-iscsi. > > My case i

Re: max_sectors_kb so small, throughout so small

2018-08-27 Thread Mike Christie
On 08/21/2018 08:52 PM, 3kboy2...@gmail.com wrote: > Hi folks, > > I am newbie to open-iscsi. > My case is I export ceph rbd by open-iscsi. > > I found the max_sectors_kb is 64, the value is so small, and 4M sequence > write is only about 10MB/s. > I can not increase max_sectors_kb, if I do it

Re: iscsistart -N skips offload NICs causing boot to fail on debian

2016-12-20 Thread Mike Christie
On 12/20/2016 12:15 PM, Andrew Patterson wrote: > On 12/12/2016 02:38 PM, Andrew Patterson wrote: >> >> >> On Friday, December 9, 2016 at 3:33:57 PM UTC-7, Mike Christie wrote: >> >> On 12/08/2016 10:55 AM, andrew.p...@hpe.com wrote: >> > I am tr

Re: iscsistart -N skips offload NICs causing boot to fail on debian

2016-12-09 Thread Mike Christie
On 12/08/2016 10:55 AM, andrew.patter...@hpe.com wrote: > I am trying to get iSCSI boot working on a debian-based system > using built-in uEFI iSCSI initiator firmware and broadcom > NICs (bnx2x). > > The debian initramfs uses the ibft support in iscsistart to log > into the root volume. The

Re: iscsi: make mutex for target scanning and unbinding per-session

2016-11-10 Thread Mike Christie
On 11/10/2016 07:13 PM, Chris Leech wrote: > On Thu, Nov 10, 2016 at 05:22:44PM -0600, Mike Christie wrote: >> > On 11/07/2016 12:22 PM, Chris Leech wrote: >>> > > Currently the iSCSI transport class synchronises target scanning and >>> > > unbinding w

Re: iscsi: make mutex for target scanning and unbinding per-session

2016-11-10 Thread Mike Christie
On 11/07/2016 12:22 PM, Chris Leech wrote: > Currently the iSCSI transport class synchronises target scanning and > unbinding with a host level mutex. For multi-session hosts (offloading > iSCSI HBAs) connecting to storage arrays that may implement one > target-per-lun, this can result in the

Re: [PATCHv2] MAINTAINERS: Update open-iscsi maintainers

2016-09-29 Thread Mike Christie
sertions(+), 3 deletions(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 01bff8ea28d8..81384a2562e7 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -6448,10 +6448,10 @@ S:Maintained > F: drivers/firmware/iscsi_ibft* > > ISCSI > -M: Mike Christie <m

Re: Kernel reported invalid or unknown error code?

2016-08-08 Thread Mike Christie
On 08/05/2016 07:34 PM, dbuech...@cablemo.com wrote: > Hello All, > > I'm seeing these messages in my messages log, as well as experiencing > corosync problems around the same time. I have searched high and low > for information on this error code and have found very little. > > From

Re: Performance issues when logging into a large number of targets

2016-06-10 Thread Mike Christie
ush...@gmail.com>> wrote: > >> Thanks for the patch Mike. Will test it with this and let you know if >> I see some improvement. And yes the gmon output is for iscsiadm and >> not iscsid. >> >> >> -Syed >> >> On Wed, Jun 8, 2016 at 1:36 PM, Mike Chri

Re: iscsistart takeover vs iface names

2016-05-27 Thread Mike Christie
I help, as I > have the same issue? > > On Thursday, October 8, 2015 at 2:48:30 PM UTC-7, Mike Christie wrote: > > On 10/08/2015 04:10 PM, Ferenc Wagner wrote: > > Mike Christie <m*@cs.wisc.edu <mailto:micha...@cs.wisc.edu>> writes: > >

Re: open-iscsi Ping timeout error.

2016-05-20 Thread Mike Christie
On 05/20/2016 04:14 PM, Mike Christie wrote: > On 05/20/2016 11:39 AM, The Lee-Man wrote: >> Hi: >> >> It seems like your backend is getting busy and not replying in time when >> it gets very busy. You can disable the NOOP, or you can lengthen its >> interval, I

Re: open-iscsi Ping timeout error.

2016-05-20 Thread Mike Christie
On 05/20/2016 11:39 AM, The Lee-Man wrote: > Hi: > > It seems like your backend is getting busy and not replying in time when > it gets very busy. You can disable the NOOP, or you can lengthen its > interval, I believe. > > If there is a bug, it would be in the kernel target subsystem. Have you

Re: Using all 24-bits of the ISID

2016-05-13 Thread Mike Christie
On 05/13/2016 11:58 AM, The Lee-Man wrote: > When we made the most recent changes to open-iscsi: > > "make use of all 24 bits of ISID qualifier space" > > we agreed it would be a "good thing" to modify the kernel > to use the "id" routines instead of an atomic int. > > I created a set of

Re: [PATCH 1/3] scsi_transport_iscsi: Add stats support for iscsi host

2016-04-22 Thread Mike Christie
On 04/22/2016 08:39 AM, adheer.chandravan...@qlogic.com wrote: > From: Adheer Chandravanshi > > Add stats for iscsi initiator that will be maintained at iscsi host level > and will be exported as iscsi_host sysfs attributes. > > Signed-off-by: Adheer

[ANNOUNCE] new open-iscsi maintainers

2016-04-22 Thread Mike Christie
Hi open-iscsi list, I am very happy to announce that Chris Leech and Lee Duncan will be taking over open-iscsi maintainership. They have created a new github organization: https://github.com/open-iscsi that will host the userspace code. Send all userspace patches to the list and to Chris

Re: [PATCH] iscsi tools: Add support for some host statistics

2016-03-30 Thread Mike Christie
avan...@qlogic.com > <mailto:adheer.chandravan...@qlogic.com>> > Reply-To: "open-iscsi@googlegroups.com > <mailto:open-iscsi@googlegroups.com>" <open-iscsi@googlegroups.com > <mailto:open-iscsi@googlegroups.com>> > Date: Thursday, 10 March 20

Re: [PATCH 0/5] Fix several static checker warnings reported against the iSCSI kernel code

2016-03-29 Thread Mike Christie
On 03/28/2016 03:39 PM, Bart Van Assche wrote: > Hello Mike, > > These five patches are what I came up with after analyzing the output of > "make M=drivers/scsi W=1 C=2" for the iSCSI kernel code. Please consider > these patches for inclusion in kernel v4.7. The actual patches are: > >

Re: NoPortalsFound

2016-03-25 Thread Mike Christie
On 03/25/2016 01:27 PM, Graham Welsh wrote: > Also, in my poking around, I discovered a debug mode : > > iscsiadm -m discovery -t st -b8 -p 192.168.0.10:3260 > > > which fives the output : > > iscsiadm: Connection to Discovery Address 192.168.0.10 closed > iscsiadm:

Re: NoPortalsFound

2016-03-11 Thread Mike Christie
On 03/11/2016 01:42 PM, ZER0SEN wrote: > Hi all, > > I'm setting up a little test network and am trying to connect my server > (control) to my storage (NAS) via iSCSI. I'm having a little issue > getting my initiator to see my target. > > When I attempt to discover my target, all I get is : >

Re: [PATCH] Use ida_simple for SCSI iSCSI transport session id

2016-03-09 Thread Mike Christie
On 03/08/2016 11:21 AM, Chris Leech wrote: > On Fri, Feb 12, 2016 at 09:38:53AM -0800, Lee Duncan wrote: >> The scsi_transport_iscsi module already uses the ida_simple >> routines for managing the target ID, if requested to do >> so. This change replaces an ever-increasing atomic integer >> that

Re: Issues on debian jessie and Dell MD3200i - connection pdu rejected

2016-03-08 Thread Mike Christie
On 03/08/2016 08:01 AM, Lars Schimmer wrote: > On 2016-03-08 14:49, Lars Schimmer wrote: >> Hi! >> >> We jsut upgraded one of our old wheezy linux server to Debian jessie. >> Now Open-iscsi spits out this error on load: >> >> >> connection1:0: pdu (op 0x1 itt 0x33) rejected. Reason code 0x5 >> [

Re: [PATCH] iscsi_tcp set SO_LINGER to abort connection for error handling

2016-03-03 Thread Mike Christie
On 03/03/2016 06:09 PM, Chris Leech wrote: > When requests are being failed it's important to abort the TCP > connection rather than let TCP wait and attempt a graceful shutdown. > > That can be accomplished by setting the SO_LINGER socket option with a > linger time of 0 to drop queued data and

Re: iSCSI disconnections after running iscsistart

2016-03-03 Thread Mike Christie
On 03/03/2016 03:17 PM, Chris Leech wrote: > On Thu, Mar 03, 2016 at 10:16:45PM +0200, Erez Zilber wrote: >> Hi, >> >> I'm running iSCSI boot for RHEL & SUSE nodes. Sometimes, after >> iscsistart is called, errors on the iSCSI target side occur (e.g. temp >> network disconnection) and the iSCSI

  1   2   3   4   5   6   7   8   9   10   >