Accepting request 139442 from Base:System

- Add tgt-mgmt-fixed-m-system-o-delete-handling.patch: Fixes
  shutdown hang (bnc#767438)
- Removed PIDFILE completely from init file, as it is not used (forwarded request 139360 from lee_duncan)

OBS-URL: https://build.opensuse.org/request/show/139442
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tgt?expand=0&rev=18
This commit is contained in:
Stephan Kulow 2012-10-27 05:56:49 +00:00 committed by Git OBS Bridge
commit 2de1d80b6a
4 changed files with 61 additions and 4 deletions

View File

@ -0,0 +1,48 @@
From 0b88336c4b188f48e6bd2e8c94e0467dc805cc38 Mon Sep 17 00:00:00 2001
From: Roi Dayan <roid@mellanox.com>
Date: Thu, 28 Jun 2012 19:56:04 +0300
Subject: mgmt: fixed -m system -o delete handling
Git-commit: 0b88336c4b188f48e6bd2e8c94e0467dc805cc38
Patch-mainline: v1.0.29
system_active was reset only in case when mgmt response was carrying data.
In case of deleting system, response code was returned in err field of the header
therefore system was not shut down.
Signed-off-by: Alexander Nezhinsky <alexandern@mellanox.com>
Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Lee Duncan <lduncan@suse.com>
---
usr/mgmt.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/usr/mgmt.c b/usr/mgmt.c
index ef1b265..56f89bb 100644
--- a/usr/mgmt.c
+++ b/usr/mgmt.c
@@ -585,13 +585,8 @@ static void mtask_recv_send_handler(int fd, int events, void *data)
err = concat_write(&mtask->rsp_concat, fd, mtask->done);
if (err >= 0) {
mtask->done += err;
- if (mtask->done == (rsp->len - sizeof(*rsp))) {
- if (req->mode == MODE_SYSTEM &&
- req->op == OP_DELETE &&
- !rsp->err)
- system_active = 0;
+ if (mtask->done == (rsp->len - sizeof(*rsp)))
goto out;
- }
} else
if (errno != EAGAIN)
goto out;
@@ -603,6 +598,8 @@ static void mtask_recv_send_handler(int fd, int events, void *data)
return;
out:
+ if (req->mode == MODE_SYSTEM && req->op == OP_DELETE && !rsp->err)
+ system_active = 0;
tgt_event_del(fd);
close(fd);
mtask_free(mtask);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Oct 26 01:14:03 UTC 2012 - lduncan@suse.com
- Add tgt-mgmt-fixed-m-system-o-delete-handling.patch: Fixes
shutdown hang (bnc#767438)
- Removed PIDFILE completely from init file, as it is not used
-------------------------------------------------------------------
Tue Jul 10 08:25:16 UTC 2012 - cfarrell@suse.com

View File

@ -18,7 +18,6 @@
#
DAEMON=/usr/sbin/tgtd
PIDFILE=/var/run/tgtd.pid
TGTD_CONFIG=/etc/tgt/targets.conf
# Source LSB init functions
@ -158,7 +157,7 @@ case "$1" in
;;
status)
echo -n "Checking for SCSI target service"
checkproc -p $PIDFILE $DAEMON
checkproc $DAEMON
rc_status -v
;;
*)

View File

@ -35,7 +35,9 @@ Source: %{name}-%{version}.tar.bz2
Source1: %{name}.init
Source3: %{name}.services
Patch1: %{name}-git-update
Patch11: %{name}-fix-build
Patch2: %{name}-fix-build
# PATCH-FIX-UPSTREAM tgt-mgmt-fixed-m-system-o-delete-handling.patch [bnc#767438] - lduncan@suse.com
Patch3: %{name}-mgmt-fixed-m-system-o-delete-handling.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -56,7 +58,8 @@ Authors:
%prep
%setup -n %{name}-%{version}
%patch1 -p1
%patch11 -p1
%patch2 -p1
%patch3 -p1
%build
%ifarch ppc ppc64