- drop the libzfcphbaapi subpackage as it is moved to its own package (#963670)

- update the zfcp udev rules (#958197)
- fix runtime dependencies for osasnmpd (#965413)
This commit is contained in:
Dan Horák 2013-05-24 10:57:23 +02:00
parent 2497f58367
commit 02f5ea8199
8 changed files with 9 additions and 288 deletions

View File

@ -1,69 +0,0 @@
Description: zfcp-hbaapi: Fix crash on HBA_FreeLibrary call.
Symptom: zfcp_ping segmentation fault without any online adapters.
Problem: Segmentation fault happens on libzfcphbaapi if it build as vendor
library at this time when SNIA HBAAPI performs dlclose of
zfcp-hbaapi after clean-up function HBA_FreeLibrary.
zfcp-hbaapi has missing the event thread clean-up.
Solution: zfcp-hbaapi event thread cleanup has been coded using
pthread_cancel and pthread_join in HBA_FreeLibrary function.
Problem-ID: 72524
---
lib-zfcp-hbaapi-2.1/vlib.c | 16 ++++++++++++++++
lib-zfcp-hbaapi-2.1/vlib.h | 2 ++
lib-zfcp-hbaapi-2.1/vlib_events.c | 4 +---
3 files changed, 19 insertions(+), 3 deletions(-)
--- a/lib-zfcp-hbaapi-2.1/vlib.c
+++ b/lib-zfcp-hbaapi-2.1/vlib.c
@@ -169,6 +169,7 @@ HBA_STATUS HBA_LoadLibrary(void)
*/
HBA_STATUS HBA_FreeLibrary(void)
{
+ void *res;
VLIB_MUTEX_LOCK(&vlib_data.mutex);
if (!vlib_data.isLoaded) {
@@ -183,6 +184,21 @@ HBA_STATUS HBA_FreeLibrary(void)
}
vlib_data.unloading = 1;
+ if (pthread_cancel(vlib_data.id) != 0) {
+ VLIB_MUTEX_UNLOCK(&vlib_data.mutex);
+ return HBA_STATUS_ERROR;
+ }
+
+ if (pthread_join(vlib_data.id, &res) != 0) {
+ VLIB_MUTEX_UNLOCK(&vlib_data.mutex);
+ return HBA_STATUS_ERROR;
+ }
+
+ if (res != PTHREAD_CANCELED) {
+ VLIB_MUTEX_UNLOCK(&vlib_data.mutex);
+ return HBA_STATUS_ERROR;
+ }
+
closeAllAdapters();
vlib_data.isLoaded = 0;
--- a/lib-zfcp-hbaapi-2.1/vlib.h
+++ b/lib-zfcp-hbaapi-2.1/vlib.h
@@ -494,6 +494,8 @@ struct vlib_data {
struct block adapters; /**< @brief List of adapters
In fact this is the anchor of
the library's repository. */
+ pthread_t id; /**< @brief Pthread ID of event
+ handling thread*/
pthread_mutex_t mutex; /**< @brief Protects this structure */
};
--- a/lib-zfcp-hbaapi-2.1/vlib_events.c
+++ b/lib-zfcp-hbaapi-2.1/vlib_events.c
@@ -241,7 +241,5 @@ void cleanup_event_thread()
void start_event_thread()
{
- pthread_t id;
-
- pthread_create(&id, NULL, &establish_listener, NULL);
+ pthread_create(&vlib_data.id, NULL, &establish_listener, NULL);
}

View File

@ -1,26 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/Makefile.am.module lib-zfcp-hbaapi-2.1/Makefile.am
--- lib-zfcp-hbaapi-2.1/Makefile.am.module 2010-07-21 09:55:20.000000000 +0200
+++ lib-zfcp-hbaapi-2.1/Makefile.am 2011-01-14 10:42:06.000000000 +0100
@@ -69,6 +69,10 @@ libzfcphbaapi_la_LDFLAGS = \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
-export-symbols $(SYMFILE)
+if VENDORLIB
+libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
+endif
+
bin_PROGRAMS = zfcp_ping zfcp_show
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
diff -up lib-zfcp-hbaapi-2.1/Makefile.in.module lib-zfcp-hbaapi-2.1/Makefile.in
--- lib-zfcp-hbaapi-2.1/Makefile.in.module 2010-09-17 13:17:17.000000000 +0200
+++ lib-zfcp-hbaapi-2.1/Makefile.in 2011-01-14 10:42:44.000000000 +0100
@@ -279,6 +279,8 @@ libzfcphbaapi_la_LDFLAGS = \
-lpthread -Wl,-init,_initvlib,-fini,_finivlib \
-export-symbols $(SYMFILE)
+@VENDORLIB_TRUE@libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
+
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_SOURCES = fc_tools/zfcp_show.c

View File

@ -1,13 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/vlib_sg_io.c.scsih lib-zfcp-hbaapi-2.1/vlib_sg_io.c
--- lib-zfcp-hbaapi-2.1/vlib_sg_io.c.scsih 2012-08-16 18:37:10.000000000 +0200
+++ lib-zfcp-hbaapi-2.1/vlib_sg_io.c 2012-08-16 18:37:48.000000000 +0200
@@ -27,7 +27,8 @@
typedef __u8 u8;
-#include <scsi/scsi.h>
+/* we really need the glibc header, not the kernel one */
+#include </usr/include/scsi/scsi.h>
#include <scsi/sg.h>
#include <linux/bsg.h>

View File

@ -1,13 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/vlib_sg_io.c.u8 lib-zfcp-hbaapi-2.1/vlib_sg_io.c
--- lib-zfcp-hbaapi-2.1/vlib_sg_io.c.u8 2011-01-14 11:57:51.000000000 +0100
+++ lib-zfcp-hbaapi-2.1/vlib_sg_io.c 2011-01-14 11:58:05.000000000 +0100
@@ -24,6 +24,9 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/time.h>
+
+typedef __u8 u8;
+
#include <scsi/scsi.h>
#include <scsi/sg.h>

View File

@ -1,37 +0,0 @@
diff -up lib-zfcp-hbaapi-2.1/Makefile.am.vendorlib lib-zfcp-hbaapi-2.1/Makefile.am
--- lib-zfcp-hbaapi-2.1/Makefile.am.vendorlib 2011-01-14 12:10:56.000000000 +0100
+++ lib-zfcp-hbaapi-2.1/Makefile.am 2011-01-14 12:12:02.000000000 +0100
@@ -76,9 +76,15 @@ endif
bin_PROGRAMS = zfcp_ping zfcp_show
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
-zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_SOURCES = fc_tools/zfcp_show.c
+
+if VENDORLIB
+zfcp_ping_LDADD = -lHBAAPI
+zfcp_show_LDADD = -lHBAAPI
+else
+zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_LDADD = -lzfcphbaapi
+endif
if DOCS
diff -up lib-zfcp-hbaapi-2.1/Makefile.in.vendorlib lib-zfcp-hbaapi-2.1/Makefile.in
--- lib-zfcp-hbaapi-2.1/Makefile.in.vendorlib 2011-01-14 12:11:01.000000000 +0100
+++ lib-zfcp-hbaapi-2.1/Makefile.in 2011-01-14 12:13:05.000000000 +0100
@@ -282,9 +282,11 @@ libzfcphbaapi_la_LDFLAGS = \
@VENDORLIB_TRUE@libzfcphbaapi_la_LDFLAGS += -module -avoid-version -release $(VERSION)
zfcp_ping_SOURCES = fc_tools/zfcp_ping.c
-zfcp_ping_LDADD = -lzfcphbaapi
zfcp_show_SOURCES = fc_tools/zfcp_show.c
-zfcp_show_LDADD = -lzfcphbaapi
+@VENDORLIB_TRUE@zfcp_ping_LDADD = -lHBAAPI
+@VENDORLIB_TRUE@zfcp_show_LDADD = -lHBAAPI
+@VENDORLIB_FALSE@zfcp_ping_LDADD = -lzfcphbaapi
+@VENDORLIB_FALSE@zfcp_show_LDADD = -lzfcphbaapi
@DOCS_FALSE@man_MANS = zfcp_show.8 zfcp_ping.8 libzfcphbaapi.3
@DOCS_TRUE@man_MANS = libzfcphbaapi.3 dox/man/man3/SupportedHBAAPIs.3 \
@DOCS_TRUE@ dox/man/man3/UnSupportedHBAAPIs.3 dox/man/man3/hbaapi.h.3 \

View File

@ -1,6 +1,5 @@
%define cmsfsver 1.1.8c
%define vipaver 2.0.4
%define hbaapiver 2.1
%{!?_initddir: %define _initddir %{_initrddir}}
@ -8,7 +7,7 @@ Name: s390utils
Summary: Utilities and daemons for IBM System/z
Group: System Environment/Base
Version: 1.20.0
Release: 3%{?dist}
Release: 4%{?dist}
Epoch: 2
License: GPLv2 and GPLv2+ and CPL
ExclusiveArch: s390 s390x
@ -22,8 +21,6 @@ Source5: zfcpconf.sh
# http://www.ibm.com/developerworks/linux/linux390/src_vipa-%%{vipaver}.html
Source6: http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/src_vipa-%{vipaver}.tar.gz
Source7: zfcp.udev
# http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi-%%{hbaapiver}.html
Source9: http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/lib-zfcp-hbaapi-%{hbaapiver}.tar.gz
# files for the Control Program Identification (Linux Call Home) feature (#463282)
Source10: cpi.initd
Source11: cpi.sysconfig
@ -46,12 +43,6 @@ Patch1002: cmsfs-1.1.8-use-detected-filesystem-block-size-on-FBA-devices.pa
Patch2000: src_vipa-2.0.4-locations.patch
Patch3001: lib-zfcp-hbaapi-2.1-module.patch
Patch3002: lib-zfcp-hbaapi-2.1-u8.patch
Patch3003: lib-zfcp-hbaapi-2.1-vendorlib.patch
Patch3004: lib-zfcp-hbaapi-2.1-HBA_FreeLibrary.patch
Patch3005: lib-zfcp-hbaapi-2.1-scsi-h.patch
Requires: s390utils-base = %{epoch}:%{version}-%{release}
Requires: s390utils-osasnmpd = %{epoch}:%{version}-%{release}
Requires: s390utils-cpuplugd = %{epoch}:%{version}-%{release}
@ -70,7 +61,7 @@ The s390utils packages contain a set of user space utilities that should to
be used together with the zSeries (s390) Linux kernel and device drivers.
%prep
%setup -q -n s390-tools-%{version} -a 4 -a 6 -a 9
%setup -q -n s390-tools-%{version} -a 4 -a 6
# Fedora/RHEL changes
%patch1 -p1 -b .fedora
@ -97,25 +88,6 @@ pushd src_vipa-%{vipaver}
%patch2000 -p1 -b .locations
popd
#
# lib-zfcp-hbaapi
#
pushd lib-zfcp-hbaapi-%{hbaapiver}
# build the library as a module
%patch3001 -p1 -b .module
# kernel headers need u8 type
%patch3002 -p1 -b .u8
# fix linking of the tools when using vendor library mode
%patch3003 -p1 -b .vendorlib
# zfcp-hbaapi: Fix crash on HBA_FreeLibrary call (#713817)
%patch3004 -p2 -b .HBA_FreeLibrary
# fix build fix recent kernels
%patch3005 -p1 -b .scsi-h
popd
# remove --strip from install
find . -name Makefile | xargs sed -i 's/$(INSTALL) -s/$(INSTALL)/g'
@ -131,12 +103,6 @@ mv CREDITS CREDITS.cmsfs
popd
pushd lib-zfcp-hbaapi-%{hbaapiver}
# lib-zfcp-hbaapi: fix perms
chmod a-x *.h AUTHORS README ChangeLog LICENSE
popd
%build
make OPT_FLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" DISTRELEASE=%{release} V=1
@ -149,15 +115,6 @@ pushd src_vipa-%{vipaver}
make CC_FLAGS="$RPM_OPT_FLAGS -fPIC" LIBDIR=%{_libdir}
popd
%ifarch Xs390x
pushd lib-zfcp-hbaapi-%{hbaapiver}
kernel_ver=$(rpm -q --qf="%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel-devel | tail -1)
export CPPFLAGS=-I/usr/src/kernels/$kernel_ver/include
%configure --disable-static --enable-vendor-lib
make EXTRA_CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
popd
%endif
%install
mkdir -p $RPM_BUILD_ROOT{%{_lib},%{_libdir},/sbin,/bin,/boot,/lib/udev/rules.d,%{_mandir}/man1,%{_mandir}/man8,%{_sbindir},%{_bindir},%{_sysconfdir}/{profile.d,sysconfig},%{_initddir}}
@ -211,17 +168,6 @@ pushd src_vipa-%{vipaver}
make install LIBDIR=%{_libdir} SBINDIR=%{_bindir} INSTROOT=$RPM_BUILD_ROOT
popd
%ifarch Xs390x
# lib-zfcp-hbaapi
pushd lib-zfcp-hbaapi-%{hbaapiver}
%makeinstall docdir=$RPM_BUILD_ROOT%{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}
popd
# keep only html docs
rm -rf $RPM_BUILD_ROOT%{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}/latex
# remove unwanted files
rm -f $RPM_BUILD_ROOT%{_libdir}/libzfcphbaapi.*
%endif
# install usefull headers for devel subpackage
mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name}
install -p -m 644 include/vtoc.h $RPM_BUILD_ROOT%{_includedir}/%{name}
@ -550,6 +496,7 @@ License: GPLv2+
Summary: SNMP sub-agent for OSA-Express cards
Group: System Environment/Daemons
Requires: net-snmp
Requires: psmisc
BuildRequires: net-snmp-devel
%description osasnmpd
@ -727,77 +674,6 @@ fi
%{_mandir}/man8/chiucvallow.8*
%{_mandir}/man9/hvc_iucv.9*
#
# *********************** libzfcphbaapi package ***********************
#
%ifarch Xs390x
%package libzfcphbaapi
License: CPL
Summary: ZFCP HBA API Library -- HBA API for the zfcp device driver
Group: System Environment/Libraries
URL: http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
BuildRequires: automake
BuildRequires: doxygen
BuildRequires: libsysfs-devel
BuildRequires: sg3_utils-devel
BuildRequires: kernel-devel
BuildRequires: libhbaapi-devel
Requires: libhbaapi
Requires(post): grep
Requires(postun): grep sed
Obsoletes: %{name}-libzfcphbaapi-devel < 2:1.8.2-4
%post libzfcphbaapi
grep -q -e "^libzfcphbaapi" /etc/hba.conf ||
echo "libzfcphbaapi %{_libdir}/libzfcphbaapi-%{hbaapiver}.so" >> /etc/hba.conf
:
%preun libzfcphbaapi
grep -q -e "^libzfcphbaapi" /etc/hba.conf &&
sed -i.orig -e "/^libzfcphbaapi/d" /etc/hba.conf
fi
:
%description libzfcphbaapi
ZFCP HBA API Library is an implementation of FC-HBA (see www.t11.org ) for
the zfcp device driver.
%files libzfcphbaapi
%doc lib-zfcp-hbaapi-%{hbaapiver}/README
%doc lib-zfcp-hbaapi-%{hbaapiver}/COPYING
%doc lib-zfcp-hbaapi-%{hbaapiver}/ChangeLog
%doc lib-zfcp-hbaapi-%{hbaapiver}/AUTHORS
%doc lib-zfcp-hbaapi-%{hbaapiver}/LICENSE
%{_bindir}/zfcp_ping
%{_bindir}/zfcp_show
%{_libdir}/libzfcphbaapi-%{hbaapiver}.so
%{_mandir}/man3/libzfcphbaapi.3*
%{_mandir}/man3/SupportedHBAAPIs.3*
%{_mandir}/man3/UnSupportedHBAAPIs.3*
%{_mandir}/man8/zfcp_ping.8*
%{_mandir}/man8/zfcp_show.8*
%exclude %{_mandir}/man3/hbaapi.h.3*
#
# *********************** libzfcphbaapi-devel package ***********************
#
%package libzfcphbaapi-docs
License: CPL
Summary: ZFCP HBA API Library -- Documentation
Group: Development/Libraries
URL: http://www.ibm.com/developerworks/linux/linux390/zfcp-hbaapi.html
Requires: %{name}-libzfcphbaapi = %{epoch}:%{version}-%{release}
%description libzfcphbaapi-docs
Documentation for the ZFCP HBA API Library.
%files libzfcphbaapi-docs
%docdir %{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}
%{_docdir}/lib-zfcp-hbaapi-%{hbaapiver}/
%endif
#
# *********************** cmsfs package ***********************
#
@ -858,6 +734,11 @@ User-space development files for the s390/s390x architecture.
%changelog
* Tue May 21 2013 Dan Horák <dan[at]danny.cz> - 2:1.20.0-4
- drop the libzfcphbaapi subpackage as it is moved to its own package (#963670)
- update the zfcp udev rules (#958197)
- fix runtime dependencies for osasnmpd (#965413)
* Wed Mar 27 2013 Dan Horák <dan[at]danny.cz> - 2:1.20.0-3
- disable libzfcphbaapi subpackage, fails to build with recent kernels

View File

@ -1,5 +1,3 @@
71a8ee5918f2c44c385fcfe8350cdc98 cmsfs-1.1.8c.tar.gz
ecf3ff0ac4469db7297ebd6f7607fb48 lib-zfcp-hbaapi-2.1.tar.gz
ba42772e5b305b5e147344442cd70826 src_vipa-2.0.4.tar.gz
db032922754fb268f21ccdbc7621d19f s390-tools-1.19.0.tar.bz2
881237b31201d46ba452fa4ff51c934c s390-tools-1.20.0.tar.bz2

View File

@ -1 +1 @@
KERNEL=="zfcp_cfdc", RUN+="/sbin/zfcpconf.sh"
KERNEL=="zfcp", RUN+="/sbin/zfcpconf.sh"