Re: [PATCH V2 0/8] lld restart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/24/2012 9:48 AM, FUJITA Tomonori wrote:
On Wed, 18 Jul 2012 12:36:07 +0300
Roi Dayan <roid@xxxxxxxxxxxx> wrote:

Hi Tomo,

This is an update for the previous set of patches for lld restart,
to add option to stop and start lld without restarting the tgtd process.

Added corresponding short help for tgtadm (--help) and the man page.

There's also a patch moving init_log before init_lld so fds won't stay open.
This patch will also fix deleting portals using tgtadm.

For example, starting an lld can be used if tgtd was started before
the rdma modules were loaded so we can later call iser init() with:
tgtadm --mode lld --lld iser --op start

Stopping an lld is only possible if there are no targets using it.

Thanks,
Roi


Roi Dayan (8):
   tgtd: fork logger before initializing llds
   For each lld save the list of targets using it
   tgt-admin: add option to restart llds
   Add documentation for starting lld while tgtd is running
   tgtadm: add help for starting lld while tgtd is running
   iser: cleaning iser ib objects on lld exit
   iscsi: deleting portals on iscsi tcp exit
   mgmt: add TGTADM_DRIVER_ACTIVE and return it when trying stop a busy
     lld

  doc/tgtadm.8.xml      |   10 +++++++
  usr/driver.h          |    2 +
  usr/iscsi/iscsi_tcp.c |   11 +++-----
  usr/iscsi/iser.c      |   66 +++++++++++++++++++++++++++++++++++++++++++++++++
  usr/mgmt.c            |   48 ++++++++++++++++++++++++++++++++++-
  usr/target.c          |   21 +++++++++++++++
  usr/target.h          |    2 +
  usr/tgtadm.c          |   30 ++++++++++++++++++++++
  usr/tgtadm.h          |    3 ++
  usr/tgtadm_error.h    |    1 +
  usr/tgtd.c            |   51 ++++++++++++++++++++++---------------
  usr/tgtd.h            |    3 ++
  12 files changed, 219 insertions(+), 29 deletions(-)

I think that I asked this before. What happens to the outstanding
commands if I do the above operation?


Hi,

Sorry for the spam I had thunderbird issues with html/text thus the mailing list rejected me.
It's resolved now.


The current patch only allows unloading an lld if there are no targets using this lld So also there are no initiators connected at all and there are no outstanding commands.

The check is in patch 3/8 in mgmt.c

+	if (tgt_drivers[lld_no]->drv_state == DRIVER_INIT) {
+	if (list_empty(&tgt_drivers[lld_no]->target_list)) {
+	if (tgt_drivers[lld_no]->exit) {
+	tgt_drivers[lld_no]->exit();
+	tgt_drivers[lld_no]->drv_state = DRIVER_EXIT;
+	}
+	adm_err = TGTADM_SUCCESS;
+	} else
+	adm_err = TGTADM_TARGET_ACTIVE;

Thanks,
Roi

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux