search for: tv_tpg_mutex

Displaying 20 results from an estimated 53 matches for "tv_tpg_mutex".

2023 Mar 21
8
[PATCH v2 0/7] vhost-scsi: Fix crashes and management op hangs
The following patches were made over Linus tree. The patches fix 3 issues: 1. If a user performs LIO LUN unmapping before the endpoint has been cleared then we can end up trying to free a bogus tmf struct if the TMF is still exucuting when we do the unmap. 2. If vhost_scsi_setup_vq_cmds fails we can leave the tpg->vhost_scsi pointer set and we can end up trying to access a freed struct. 3.
2013 May 03
5
[PATCH 0/5] vhost-scsi cleanup
Asias He (5): vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration vhost-scsi: Rename struct vhost_scsi *s to *vs vhost-scsi: Make func indention more consistent vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg vhost-scsi: Rename struct tcm_vhost_cmd *tv_cmd to *cmd drivers/vhost/scsi.c | 469 +++++++++++++++++++++++++++------------------------ 1 file changed,
2013 May 03
5
[PATCH 0/5] vhost-scsi cleanup
Asias He (5): vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration vhost-scsi: Rename struct vhost_scsi *s to *vs vhost-scsi: Make func indention more consistent vhost-scsi: Rename struct tcm_vhost_tpg *tv_tpg to *tpg vhost-scsi: Rename struct tcm_vhost_cmd *tv_cmd to *cmd drivers/vhost/scsi.c | 469 +++++++++++++++++++++++++++------------------------ 1 file changed,
2023 Feb 23
5
[PATCH 0/5] vhost-scsi: Fix management operation hangs
The following patches were made over Linus tree and also apply over mst tree's vhost branch. The patches fix an issue where management operations like LUN mapping/unmapping and device addition hang for 30 seconds or up to N minutes depending on the device. The problem is that we use a global mutex to protect the list of tpgs but we hold that mutex during those management operations. So if you
2013 May 06
13
[PATCH v2 00/11] vhost cleanups
MST, This is on top of [PATCH 0/2] vhost-net fix ubuf. Asias He (11): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module vhost: Remove comments for hdr in vhost.h vhost: Simplify dev->vqs[i] access vhost-net: Cleanup vhost_ubuf and vhost_zcopy vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration
2013 May 06
13
[PATCH v2 00/11] vhost cleanups
MST, This is on top of [PATCH 0/2] vhost-net fix ubuf. Asias He (11): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module vhost: Remove comments for hdr in vhost.h vhost: Simplify dev->vqs[i] access vhost-net: Cleanup vhost_ubuf and vhost_zcopy vhost-scsi: Remove unnecessary forward struct vhost_scsi declaration
2013 Apr 25
9
[PATCH v11 0/4] tcm_vhost hotplug
Changes in v11 - Drop change log histroy in commit log Changes in v10 - Drop comments about lun - Add Enable VIRTIO_SCSI_F_HOTPLUG to this series Changes in v9 - Drop tcm_vhost_check_feature - Add Refactor the lock nesting rule to this sereis Asias He (4): tcm_vhost: Refactor the lock nesting rule tcm_vhost: Add hotplug/hotunplug support tcm_vhost: Add ioctl to get and set events missed
2013 Apr 25
9
[PATCH v11 0/4] tcm_vhost hotplug
Changes in v11 - Drop change log histroy in commit log Changes in v10 - Drop comments about lun - Add Enable VIRTIO_SCSI_F_HOTPLUG to this series Changes in v9 - Drop tcm_vhost_check_feature - Add Refactor the lock nesting rule to this sereis Asias He (4): tcm_vhost: Refactor the lock nesting rule tcm_vhost: Add hotplug/hotunplug support tcm_vhost: Add ioctl to get and set events missed
2012 Jul 30
0
[PATCH] tcm_vhost: Post-merge review changes requested by MST
...i_complete_cmd_work() - Change vhost_scsi_*_handle_kick() to use pr_debug - Fix possible race in vhost_scsi_set_endpoint() for vs->vs_tpg checking + assignment. - Convert tv_tpg->tpg_vhost_count + ->tv_tpg_port_count from atomic_t -> int, and make sure reference is protected by ->tv_tpg_mutex. - Drop unnecessary vhost_scsi->vhost_ref_cnt - Add 'err:' label for exception path in vhost_scsi_clear_endpoint() - Add enum for VQ numbers, add usage in vhost_scsi_open() - Add vhost_scsi_flush() + vhost_scsi_flush_vq() following drivers/vhost/net.c - Add smp_wmb() + vhost_scsi_flush...
2012 Jul 30
0
[PATCH] tcm_vhost: Post-merge review changes requested by MST
...i_complete_cmd_work() - Change vhost_scsi_*_handle_kick() to use pr_debug - Fix possible race in vhost_scsi_set_endpoint() for vs->vs_tpg checking + assignment. - Convert tv_tpg->tpg_vhost_count + ->tv_tpg_port_count from atomic_t -> int, and make sure reference is protected by ->tv_tpg_mutex. - Drop unnecessary vhost_scsi->vhost_ref_cnt - Add 'err:' label for exception path in vhost_scsi_clear_endpoint() - Add enum for VQ numbers, add usage in vhost_scsi_open() - Add vhost_scsi_flush() + vhost_scsi_flush_vq() following drivers/vhost/net.c - Add smp_wmb() + vhost_scsi_flush...
2013 Apr 25
6
[PATCH v10 0/4] tcm_vhost hotplug
Asias He (4): tcm_vhost: Refactor the lock nesting rule tcm_vhost: Add hotplug/hotunplug support tcm_vhost: Add ioctl to get and set events missed flag tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG drivers/vhost/tcm_vhost.c | 262 +++++++++++++++++++++++++++++++++++++++++++--- drivers/vhost/tcm_vhost.h | 13 +++ 2 files changed, 259 insertions(+), 16 deletions(-) -- 1.8.1.4
2013 Apr 25
6
[PATCH v10 0/4] tcm_vhost hotplug
Asias He (4): tcm_vhost: Refactor the lock nesting rule tcm_vhost: Add hotplug/hotunplug support tcm_vhost: Add ioctl to get and set events missed flag tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG drivers/vhost/tcm_vhost.c | 262 +++++++++++++++++++++++++++++++++++++++++++--- drivers/vhost/tcm_vhost.h | 13 +++ 2 files changed, 259 insertions(+), 16 deletions(-) -- 1.8.1.4
2013 Mar 08
8
[PATCH V2 0/6] tcm_vhost hotplug/hotunplug support and locking/flushing fix
Changes in v2: - Remove code duplication in tcm_vhost_{hotplug,hotunplug} - Fix racing of vs_events_nr - Add flush fix patch to this series Asias He (6): tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint() tcm_vhost: Introduce tcm_vhost_check_feature() tcm_vhost: Introduce tcm_vhost_check_endpoint() tcm_vhost: Fix vs->vs_endpoint checking in vhost_scsi_handle_vq() tcm_vhost:
2013 Mar 08
8
[PATCH V2 0/6] tcm_vhost hotplug/hotunplug support and locking/flushing fix
Changes in v2: - Remove code duplication in tcm_vhost_{hotplug,hotunplug} - Fix racing of vs_events_nr - Add flush fix patch to this series Asias He (6): tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint() tcm_vhost: Introduce tcm_vhost_check_feature() tcm_vhost: Introduce tcm_vhost_check_endpoint() tcm_vhost: Fix vs->vs_endpoint checking in vhost_scsi_handle_vq() tcm_vhost:
2012 Jul 26
2
[RFC-v5] tcm_vhost: Initial merge for vhost level target fabric driver
...v.mutex); + return -EFAULT; + } + } + + if (vs->vs_tpg) { + mutex_unlock(&vs->dev.mutex); + return -EEXIST; + } + mutex_unlock(&vs->dev.mutex); + + mutex_lock(&tcm_vhost_mutex); + list_for_each_entry(tv_tpg, &tcm_vhost_list, tv_tpg_list) { + mutex_lock(&tv_tpg->tv_tpg_mutex); + if (!tv_tpg->tpg_nexus) { + mutex_unlock(&tv_tpg->tv_tpg_mutex); + continue; + } + if (atomic_read(&tv_tpg->tv_tpg_vhost_count)) { + mutex_unlock(&tv_tpg->tv_tpg_mutex); + continue; + } + tv_tport = tv_tpg->tport; + + if (!strcmp(tv_tport->tport_name,...
2012 Jul 26
2
[RFC-v5] tcm_vhost: Initial merge for vhost level target fabric driver
...v.mutex); + return -EFAULT; + } + } + + if (vs->vs_tpg) { + mutex_unlock(&vs->dev.mutex); + return -EEXIST; + } + mutex_unlock(&vs->dev.mutex); + + mutex_lock(&tcm_vhost_mutex); + list_for_each_entry(tv_tpg, &tcm_vhost_list, tv_tpg_list) { + mutex_lock(&tv_tpg->tv_tpg_mutex); + if (!tv_tpg->tpg_nexus) { + mutex_unlock(&tv_tpg->tv_tpg_mutex); + continue; + } + if (atomic_read(&tv_tpg->tv_tpg_vhost_count)) { + mutex_unlock(&tv_tpg->tv_tpg_mutex); + continue; + } + tv_tport = tv_tpg->tport; + + if (!strcmp(tv_tport->tport_name,...
2019 Apr 16
1
[PATCH] vhost-scsi: remove incorrect memory barrier
At this point, vs_tpg is not public at all; tv_tpg_vhost_count is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is accessed under vhost_scsi_mutex. Therefor there are no atomic operations involved at all here, just remove the barrier. Reported-by: Andrea Parri <andrea.parri at amarulasolutions.com> Signed-off-by: Paolo Bonzini <pbonzini at redhat.com> --- drivers/vhost/scsi...
2023 Feb 23
1
[PATCH 3/5] vhost-scsi: Remove vhost_scsi_mutex from port link/unlink
...tatic LIST_HEAD(vhost_scsi_list); @@ -2038,17 +2038,12 @@ static int vhost_scsi_port_link(struct se_portal_group *se_tpg, INIT_LIST_HEAD(&tmf->queue_entry); vhost_work_init(&tmf->vwork, vhost_scsi_tmf_resp_work); - mutex_lock(&vhost_scsi_mutex); - mutex_lock(&tpg->tv_tpg_mutex); tpg->tv_tpg_port_count++; list_add_tail(&tmf->queue_entry, &tpg->tmf_queue); mutex_unlock(&tpg->tv_tpg_mutex); vhost_scsi_hotplug(tpg, lun); - - mutex_unlock(&vhost_scsi_mutex); - return 0; } @@ -2059,8 +2054,6 @@ static void vhost_scsi_port_unlink(struc...
2012 Jul 18
6
[RFC-v3 0/4] tcm_vhost+cmwq fabric driver code for-3.6
From: Nicholas Bellinger <nab at linux-iscsi.org> Hi folks, The following is the RFC-v3 series of tcm_vhost target fabric driver code currently in-flight for-3.6 mainline code. With the merge window opening soon, the tcm_vhost code has started seeing time in linux-next. The v2 -> v3 changelog from the last week is currently looking like: *) Unlock on error in tcm_vhost_drop_nexus()
2012 Jul 18
6
[RFC-v3 0/4] tcm_vhost+cmwq fabric driver code for-3.6
From: Nicholas Bellinger <nab at linux-iscsi.org> Hi folks, The following is the RFC-v3 series of tcm_vhost target fabric driver code currently in-flight for-3.6 mainline code. With the merge window opening soon, the tcm_vhost code has started seeing time in linux-next. The v2 -> v3 changelog from the last week is currently looking like: *) Unlock on error in tcm_vhost_drop_nexus()