diff -Nru openafs-1.6.18.3/acinclude.m4 openafs-1.6.20/acinclude.m4 --- openafs-1.6.18.3/acinclude.m4 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/acinclude.m4 2016-11-30 20:06:42.000000000 +0000 @@ -1379,6 +1379,8 @@ XBSADIR2=/opt/tivoli/tsm/client/api/bin/xopen XBSADIR3=/usr/tivoli/tsm/client/api/bin/sample XBSADIR4=/opt/tivoli/tsm/client/api/bin/sample + XBSADIR5=/usr/tivoli/tsm/client/api/bin64/sample + XBSADIR6=/opt/tivoli/tsm/client/api/bin64/sample if test -r "$XBSADIR3/dsmapifp.h"; then XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I$XBSADIR3" @@ -1388,6 +1390,14 @@ XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I$XBSADIR4" XBSA_XLIBS="-ldl" AC_MSG_RESULT([yes, $XBSA_CFLAGS]) + elif test -r "$XBSADIR5/dsmapifp.h"; then + XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I$XBSADIR5" + XBSA_XLIBS="-ldl" + AC_MSG_RESULT([yes, $XBSA_CFLAGS]) + elif test -r "$XBSADIR6/dsmapifp.h"; then + XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I$XBSADIR6" + XBSA_XLIBS="-ldl" + AC_MSG_RESULT([yes, $XBSA_CFLAGS]) elif test -r "$XBSADIR1/xbsa.h"; then XBSA_CFLAGS="-Dxbsa -I$XBSADIR1" XBSA_XLIBS="" diff -Nru openafs-1.6.18.3/configure.ac openafs-1.6.20/configure.ac --- openafs-1.6.18.3/configure.ac 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/configure.ac 2016-11-30 20:06:42.000000000 +0000 @@ -5,8 +5,8 @@ AM_INIT_AUTOMAKE AC_CONFIG_HEADER(src/config/afsconfig.h) -MACOS_VERSION=1.6.19d3 -LINUX_PKGVER=1.6.18.3 +MACOS_VERSION=1.6.20 +LINUX_PKGVER=1.6.20 dnl Debian wants the release candidate version in the main upstream version, dnl and wants ~ before it. diff -Nru openafs-1.6.18.3/configure-libafs.ac openafs-1.6.20/configure-libafs.ac --- openafs-1.6.18.3/configure-libafs.ac 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/configure-libafs.ac 2016-11-30 20:06:42.000000000 +0000 @@ -5,7 +5,7 @@ AM_INIT_AUTOMAKE AC_CONFIG_HEADER(src/config/afsconfig.h) -MACOS_VERSION=1.6.19d3 +MACOS_VERSION=1.6.20 AC_SUBST(MACOS_VERSION) diff -Nru openafs-1.6.18.3/debian/changelog openafs-1.6.20/debian/changelog --- openafs-1.6.18.3/debian/changelog 2016-08-04 19:48:34.000000000 +0000 +++ openafs-1.6.20/debian/changelog 2016-12-01 05:15:33.000000000 +0000 @@ -1,8 +1,52 @@ -openafs (1.6.18.3-1~ppa0~ubuntu16.10.1) yakkety; urgency=medium +openafs (1.6.20-1ppa1~ubuntu16.10.1) yakkety; urgency=medium + * Build-Depend debhelper (>= 9.20160114) for dh_strip + --dbgsym-migration. + * debian/patches: + - LINUX-split-dentry-eviction-from-osi_TryEvictVCache.patch, + Reformat-src-afs-LINUX-osi_vcache.c.patch, + LINUX-do-not-use-d_invalidate-to-evict-dentries.patch, + afs-shake-harder-in-shake-loose-vcaches.patch: Avoid system hangs on + busy machines due to vcache deallocation failures. + - Linux-4.9-deal-with-demise-of-GROUP_AT.patch, + Linux-4.9-inode_operation-rename-now-takes-flags.patch, + Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch: Support + Linux kernel 4.9. * Build for PPA. - -- Anders Kaseorg Thu, 04 Aug 2016 15:48:34 -0400 + -- Anders Kaseorg Thu, 01 Dec 2016 00:15:33 -0500 + +openafs (1.6.20-1) unstable; urgency=high + + * New upstream release (1.6.19): + - Fix issue that could result in using out-of-date database versions + in rare cases + - Don't commit more data to a file than was actually copied during writes, + which could happen on architectures with a page size greater than 4K + * New upstream security release (1.6.20): + - Fix information leakage (file/directory names) from reused directory + buffers + + -- Benjamin Kaduk Wed, 30 Nov 2016 16:52:29 -0500 + +openafs (1.6.18.3-3) unstable; urgency=medium + + * Drop openafs-dbg in favor of automatically generated dbgsym packages. + * Mark openafs-doc Multi-Arch: foreign. + * debian/patches/tests-util-ktime-t.c-Specify-EST-offset-in-TZ.patch: + Fix FTBFS with tzdata uninstalled. (Closes: #839481) + * Depend lsb-base (>= 3.0-6) in openafs-client and openafs-fileserver + for /lib/lsb/init-functions. + + -- Anders Kaseorg Wed, 12 Oct 2016 18:04:12 -0400 + +openafs (1.6.18.3-2) unstable; urgency=medium + + * Drop hardening-wrapper in favor of passing flags via CC. + (Closes: #836642) + * Clean doxyen-generated documentation with dh_doxygen. + + -- Anders Kaseorg Sun, 11 Sep 2016 17:15:39 -0400 openafs (1.6.18.3-1) unstable; urgency=medium diff -Nru openafs-1.6.18.3/debian/control openafs-1.6.20/debian/control --- openafs-1.6.18.3/debian/control 2016-08-04 19:48:32.000000000 +0000 +++ openafs-1.6.20/debian/control 2016-12-01 05:15:19.000000000 +0000 @@ -4,10 +4,10 @@ Maintainer: Benjamin Kaduk Uploaders: Russ Allbery , Sam Hartman , Anders Kaseorg -Build-Depends: debhelper (>= 9), autoconf, automake, bison, comerr-dev, - cpio, flex, hardening-wrapper, libfuse-dev, libkrb5-dev, libncurses5-dev, +Build-Depends: debhelper (>= 9.20160114~), autoconf, automake, bison, comerr-dev, + cpio, flex, libfuse-dev, libkrb5-dev, libncurses5-dev, libpam0g-dev, libxml2-utils, perl, pkg-config, dh-systemd -Build-Depends-Indep: dblatex, dkms (>= 2.1.1.1), docbook-xsl, doxygen, +Build-Depends-Indep: dblatex, dkms (>= 2.1.1.1), docbook-xsl, doxygen (>= 1.8.4-1~), xsltproc Standards-Version: 3.9.8 Homepage: http://www.openafs.org/ @@ -16,7 +16,7 @@ Package: openafs-client Architecture: alpha amd64 arm armel armhf i386 ia64 powerpc powerpcspe ppc64 s390 s390x sparc -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6) Recommends: lsof, openafs-modules-dkms (>= ${source:Version}) | openafs-modules-source (>= ${source:Version}) | openafs-modules3 @@ -66,7 +66,7 @@ Package: openafs-fileserver Architecture: alpha amd64 arm armel armhf i386 ia64 powerpc powerpcspe ppc64 s390 s390x sparc -Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, openafs-client +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.0-6), openafs-client Recommends: ntp | time-daemon Suggests: openafs-doc Description: AFS distributed filesystem file server @@ -95,6 +95,7 @@ Package: openafs-doc Section: doc Architecture: all +Multi-Arch: foreign Depends: ${misc:Depends} Description: AFS distributed filesystem documentation AFS is a distributed filesystem allowing cross-platform sharing of files @@ -216,17 +217,3 @@ kaserver for authentication. New sites should use a Kerberos v5 implementation, a Kerberos v5 PAM module such as libpam-krb5, and libpam-afs-session. - -Package: openafs-dbg -Section: debug -Priority: extra -Architecture: alpha amd64 arm armel armhf i386 ia64 powerpc powerpcspe ppc64 s390 s390x sparc -Depends: ${misc:Depends}, openafs-fileserver (= ${binary:Version}) - | openafs-dbserver (= ${binary:Version}) -Description: AFS distributed filesystem debugging information - AFS is a distributed filesystem allowing cross-platform sharing of - files among multiple computers. Facilities are provided for access - control, authentication, backup and administrative management. - . - This package contains the debugging information for the OpenAFS - server binaries (the openafs-fileserver and openafs-dbserver packages). diff -Nru openafs-1.6.18.3/debian/patches/afs-shake-harder-in-shake-loose-vcaches.patch openafs-1.6.20/debian/patches/afs-shake-harder-in-shake-loose-vcaches.patch --- openafs-1.6.18.3/debian/patches/afs-shake-harder-in-shake-loose-vcaches.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/afs-shake-harder-in-shake-loose-vcaches.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,109 @@ +From 163fcc59b919877ee01d4fd47be46009e97a5e60 Mon Sep 17 00:00:00 2001 +From: Michael Meffie +Date: Thu, 27 Aug 2015 13:06:05 -0400 +Subject: afs: shake harder in shake-loose-vcaches + +Linux based cache managers will allocate vcaches on demand and +deallocate batches of vcaches in the background. This feature is called +dynamic vcaches. + +Vcaches to be deallocated are found by traversing the vcache LRU list +(VLRU) from the oldest vcache to the newest. Up to a target number of +vcaches are attempted to be evicted. The afs_xvcache lock protecting +the VLRU may be dropped and re-acquired while attempting to evict a +vcache. When this happens, it is possible the VLRU may have changed, so +the traversal of the VLRU is restarted. This restarting of the VLRU +transversal is limited to 100 iterations to avoid looping indefinitely. + +Vcaches which are busy cannot be evicted and remain in the VLRU. When a +busy cache was not evicted and the afs_xvache lock was dropped, the VLRU +traversal is restarted from the end of the VLRU. When the busy vcache is +encountered on the retry, it will trigger additional retries until the +loop limit is reached, at which point the target number of vcaches will +not be deallocated. + +This can leave a very large number of unbusy vcaches which are never +deallocated. On a busy machine, tens of millions of unused vcaches can +remain in memory. When the busy vcache at the end of the VLRU is finally +evicted, the log jam is broken, and the background deamon will hold the +afs_xvcache lock for an excessively long time, hanging the system. + +Fix this by moving busy vcaches to the head of the VLRU before +restarting the VLRU traversal. These busy vcaches will be skipped when +retrying the VLRU traversal, allowing the cache manager to make progress +deallocating vcaches down to the target level. + +This was already done on the mac osx platform while attempting to evict +vcaches. Move the code to move busy vcaches to the head of the VLRU up +the the platform agnostic caller. + +Thanks to Andrew Deason for the initial version of this patch. + +Reviewed-on: https://gerrit.openafs.org/11654 +Tested-by: BuildBot +Reviewed-by: Andrew Deason +Reviewed-by: Benjamin Kaduk +(cherry picked from commit 5c136c7d93ed97166f39bf716cc7f5d579b70677) + +Change-Id: If60b1889d012a739aa5b43e842abb80a6ebfdb6a +--- + src/afs/DARWIN/osi_vcache.c | 5 +---- + src/afs/afs_vcache.c | 14 +++++++++++++- + 2 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/src/afs/DARWIN/osi_vcache.c b/src/afs/DARWIN/osi_vcache.c +index 18d8d9a08..1a1199c4c 100644 +--- a/src/afs/DARWIN/osi_vcache.c ++++ b/src/afs/DARWIN/osi_vcache.c +@@ -53,10 +53,7 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) { + * this out, since the iocount we have to hold makes it + * always "fail" */ + if (AFSTOV(avc) == tvp) { +- if (*slept) { +- QRemove(&avc->vlruq); +- QAdd(&VLRU, &avc->vlruq); +- } ++ /* Caller will move this vcache to the head of the VLRU. */ + return 0; + } else + return 1; +diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c +index d751a564c..ca5a956ea 100644 +--- a/src/afs/afs_vcache.c ++++ b/src/afs/afs_vcache.c +@@ -725,6 +725,7 @@ int + afs_ShakeLooseVCaches(afs_int32 anumber) + { + afs_int32 i, loop; ++ int evicted; + struct vcache *tvc; + struct afs_q *tq, *uq; + int fv_slept, defersleep = 0; +@@ -752,12 +753,23 @@ afs_ShakeLooseVCaches(afs_int32 anumber) + } + + fv_slept = 0; +- if (osi_TryEvictVCache(tvc, &fv_slept, defersleep)) ++ evicted = osi_TryEvictVCache(tvc, &fv_slept, defersleep); ++ if (evicted) { + anumber--; ++ } + + if (fv_slept) { + if (loop++ > 100) + break; ++ if (!evicted) { ++ /* ++ * This vcache was busy and we slept while trying to evict it. ++ * Move this busy vcache to the head of the VLRU so vcaches ++ * following this busy vcache can be evicted during the retry. ++ */ ++ QRemove(&tvc->vlruq); ++ QAdd(&VLRU, &tvc->vlruq); ++ } + goto retry; /* start over - may have raced. */ + } + if (uq == &VLRU) { +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/Linux-4.9-deal-with-demise-of-GROUP_AT.patch openafs-1.6.20/debian/patches/Linux-4.9-deal-with-demise-of-GROUP_AT.patch --- openafs-1.6.18.3/debian/patches/Linux-4.9-deal-with-demise-of-GROUP_AT.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/Linux-4.9-deal-with-demise-of-GROUP_AT.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,54 @@ +From 10fd7e53aa9086b6fba94dd3340517cbc7294655 Mon Sep 17 00:00:00 2001 +From: Mark Vitale +Date: Wed, 14 Sep 2016 18:01:22 -0400 +Subject: Linux 4.9: deal with demise of GROUP_AT + +Linux commit 81243eacfa40 "cred: simpler, 1D supplementary groups" +refactors the group_info struct, removing some members (which OpenAFS +references only through the GROUP_AT macro) and adding a gid member. +The GROUP_AT macro is also removed from the tree. + +Add an autoconfigure test for the new group_info member gid and define a +replacement GROUP_AT macro to do the right thing under the new regime. + +Change-Id: I85a52c0ae0d91fc141a523f443a4ffc05eb72a2b +Reviewed-on: https://gerrit.openafs.org/12390 +Tested-by: BuildBot +Reviewed-by: Benjamin Kaduk +(cherry picked from commit 8e81b182e36cde28ec5708e5fcbe56e4900b1ea3) +--- + acinclude.m4 | 1 + + src/afs/LINUX/osi_machdep.h | 5 +++++ + 2 files changed, 6 insertions(+) + +diff --git a/acinclude.m4 b/acinclude.m4 +index c645c3d03..38eefceb6 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -878,6 +878,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + AC_CHECK_LINUX_STRUCT([ctl_table], [ctl_name], [sysctl.h]) + AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_alias], [dcache.h]) + AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h]) ++ AC_CHECK_LINUX_STRUCT([group_info], [gid], [cred.h]) + AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h]) + AC_CHECK_LINUX_STRUCT([inode], [i_blkbits], [fs.h]) + AC_CHECK_LINUX_STRUCT([inode], [i_blksize], [fs.h]) +diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h +index 54efc99b6..4448fdcfd 100644 +--- a/src/afs/LINUX/osi_machdep.h ++++ b/src/afs/LINUX/osi_machdep.h +@@ -146,6 +146,11 @@ static inline long copyinstr(char *from, char *to, int count, int *length) { + #define NGROUPS NGROUPS_SMALL + #endif + ++#ifdef STRUCT_GROUP_INFO_HAS_GID ++/* compat macro for Linux 4.9 */ ++#define GROUP_AT(gi,x) ((gi)->gid[x]) ++#endif ++ + typedef struct task_struct afs_proc_t; + + #ifdef HAVE_LINUX_KUID_T +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch openafs-1.6.20/debian/patches/Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch --- openafs-1.6.18.3/debian/patches/Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,54 @@ +From 89199cf23e8d61bc010eebb45c987d531927f3b2 Mon Sep 17 00:00:00 2001 +From: Mark Vitale +Date: Thu, 20 Oct 2016 00:49:37 -0400 +Subject: Linux 4.9: inode_change_ok() becomes setattr_prepare() + +Linux commit 31051c85b5e2 "fs: Give dentry to inode_change_ok() instead +of inode" renames and modifies inode_change_ok(inode, attrs) to +setattr_prepare(dentry, attrs). + +Modify OpenAFS to cope. + +Change-Id: I72f8dfbdbd25d7c775e9c35116e323ea4359e95c +Reviewed-on: https://gerrit.openafs.org/12418 +Tested-by: BuildBot +Reviewed-by: Benjamin Kaduk +(cherry picked from commit 8aeb711eeaa5ddac5a74c354091e2d4f7ac0cd63) +--- + acinclude.m4 | 3 +++ + src/afs/LINUX/osi_file.c | 4 ++++ + 2 files changed, 7 insertions(+) + +diff --git a/acinclude.m4 b/acinclude.m4 +index c9291bfdb..966d05d8f 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -1020,6 +1020,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + AC_CHECK_LINUX_FUNC([set_nlink], + [#include ], + [set_nlink(NULL, 1);]) ++ AC_CHECK_LINUX_FUNC([setattr_prepare], ++ [#include ], ++ [setattr_prepare(NULL, NULL);]) + AC_CHECK_LINUX_FUNC([sock_create_kern], + [#include ], + [sock_create_kern(0, 0, 0, NULL);]) +diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c +index ea0ea5d23..b230c0bf5 100644 +--- a/src/afs/LINUX/osi_file.c ++++ b/src/afs/LINUX/osi_file.c +@@ -184,7 +184,11 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize) + newattrs.ia_ctime = CURRENT_TIME; + + /* avoid notify_change() since it wants to update dentry->d_parent */ ++#ifdef HAVE_LINUX_SETATTR_PREPARE ++ code = setattr_prepare(file_dentry(afile->filp), &newattrs); ++#else + code = inode_change_ok(inode, &newattrs); ++#endif + if (!code) + code = afs_inode_setattr(afile, &newattrs); + if (!code) +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/Linux-4.9-inode_operation-rename-now-takes-flags.patch openafs-1.6.20/debian/patches/Linux-4.9-inode_operation-rename-now-takes-flags.patch --- openafs-1.6.18.3/debian/patches/Linux-4.9-inode_operation-rename-now-takes-flags.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/Linux-4.9-inode_operation-rename-now-takes-flags.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,95 @@ +From b025473a664a5dcbdeb496aafebace60820377e1 Mon Sep 17 00:00:00 2001 +From: Mark Vitale +Date: Fri, 16 Sep 2016 19:01:19 -0400 +Subject: Linux 4.9: inode_operation rename now takes flags + +In Linux 3.15 commit 520c8b16505236fc82daa352e6c5e73cd9870cff, +inode_operation rename2() was added. It takes the same arguments as +rename(), with an added flags argument supporting the following values: + +RENAME_NOREPLACE: if "new" name exists, fail with -EEXIST. Without +this flag, the default behavior is to replace the "new" existing file. + +RENAME_EXCHANGE: exchange source and target; both must exist. + +OpenAFS never implemented a .rename2() routine because it was optional +when introduced at Linux v3.15. + +In Linux 4.9-rc1 the following commits remove the last in-tree uses of +.rename() and converts .rename2() to .rename(). +aadfa8019e81 vfs: add note about i_op->rename changes to porting +2773bf00aeb9 fs: rename "rename2" i_op to "rename" +18fc84dafaac vfs: remove unused i_op->rename +1cd66c93ba8c fs: make remaining filesystems use .rename2 +e0e0be8a8355 libfs: support RENAME_NOREPLACE in simple_rename() +f03b8ad8d386 fs: support RENAME_NOREPLACE for local filesystems + +With these changes, it is now mandatory for OpenAFS afs_linux_rename() +to accept a 5th flag argument. + +Add an autoconfig test to determine the signature of .rename(). Use this +information to implement afs_linux_rename() with the appropriate number +of arguments. Implement "toleration support" for the flags option by +treating a zero flag as a normal rename; if any flags are specified, +return -EINVAL to indicate the OpenAFS filesystem does not yet support +any flags. + +Change-Id: I165d2b7956942446d97beda8504ac1ed5185a036 +Reviewed-on: https://gerrit.openafs.org/12391 +Tested-by: BuildBot +Reviewed-by: Benjamin Kaduk +(cherry picked from commit f21e3ef8ce5093b4e0578d29666f76bd99aef1a2) +--- + acinclude.m4 | 6 ++++++ + src/afs/LINUX/osi_vnodeops.c | 11 ++++++++++- + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 38eefceb6..c9291bfdb 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -854,6 +854,12 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + [#include ], + [void], + [struct inode *inode, void *link_data]) ++ AC_CHECK_LINUX_OPERATION([inode_operations], [rename], [takes_flags], ++ [#include ], ++ [int], ++ [struct inode *oinode, struct dentry *odentry, ++ struct inode *ninode, struct dentry *ndentry, ++ unsigned int flags]) + + dnl Check for header files + AC_CHECK_LINUX_HEADER([config.h]) +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index ce89ebfb2..4a8f0e9dc 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -1821,7 +1821,11 @@ afs_linux_rmdir(struct inode *dip, struct dentry *dp) + + static int + afs_linux_rename(struct inode *oldip, struct dentry *olddp, +- struct inode *newip, struct dentry *newdp) ++ struct inode *newip, struct dentry *newdp ++#ifdef HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS ++ , unsigned int flags ++#endif ++ ) + { + int code; + cred_t *credp = crref(); +@@ -1829,6 +1833,11 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, + const char *newname = newdp->d_name.name; + struct dentry *rehash = NULL; + ++#ifdef HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS ++ if (flags) ++ return -EINVAL; /* no support for new flags yet */ ++#endif ++ + /* Prevent any new references during rename operation. */ + + if (!d_unhashed(newdp)) { +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/LINUX-do-not-use-d_invalidate-to-evict-dentries.patch openafs-1.6.20/debian/patches/LINUX-do-not-use-d_invalidate-to-evict-dentries.patch --- openafs-1.6.18.3/debian/patches/LINUX-do-not-use-d_invalidate-to-evict-dentries.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/LINUX-do-not-use-d_invalidate-to-evict-dentries.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,63 @@ +From 83a174de588c56cedbf13e6abab786fb56e8082f Mon Sep 17 00:00:00 2001 +From: Mark Vitale +Date: Thu, 4 Aug 2016 18:42:27 -0400 +Subject: LINUX: do not use d_invalidate to evict dentries + +When working within the AFS filespace, commands which access large +numbers of OpenAFS files (e.g., git operations and builds) may result in +active files (e.g., the current working directory) being evicted from the +dentry cache. One symptom of this is the following message upon return +to the shell prompt: + +"fatal: unable to get current working directory: No such file or +directory" + +Starting with Linux 3.18, d_invalidate returns void because it always +succeeds. Commit a42f01d5ebb13da575b3123800ee6990743155ab adapted +OpenAFS to cope with the new return type, but not with the changed +semantics of d_invalidate. Because d_invalidate can no longer fail with +-EBUSY when invoked on an in-use dentry. OpenAFS must no longer trust it +to preserve in-use dentries. + +Modify the dentry eviction code to use a method (d_prune_aliases) that +does not evict in-use dentries. + +Reviewed-on: https://gerrit.openafs.org/12363 +Reviewed-by: Benjamin Kaduk +Tested-by: Benjamin Kaduk +(cherry picked from commit c3bbf0b4444db88192eea4580ac9e9ca3de0d286) + +Change-Id: Ic72a280f136cc414b54d4b8ec280f225290df122 +--- + src/afs/LINUX/osi_vcache.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c +index bc74b6744..23040b12c 100644 +--- a/src/afs/LINUX/osi_vcache.c ++++ b/src/afs/LINUX/osi_vcache.c +@@ -24,6 +24,13 @@ TryEvictDentries(struct vcache *avc) + struct hlist_node *p; + #endif + ++#if defined(D_INVALIDATE_IS_VOID) ++ /* At this kernel level, d_invalidate always succeeds; ++ * that is, it will now invalidate even an active directory, ++ * Therefore we must use a different method to evict dentries. ++ */ ++ d_prune_aliases(inode); ++#else + #if defined(HAVE_DCACHE_LOCK) + spin_lock(&dcache_lock); + +@@ -78,6 +85,7 @@ restart: + spin_unlock(&inode->i_lock); + #endif /* HAVE_DCACHE_LOCK */ + inuse: ++#endif /* D_INVALIDATE_IS_VOID */ + return; + } + +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/LINUX-split-dentry-eviction-from-osi_TryEvictVCache.patch openafs-1.6.20/debian/patches/LINUX-split-dentry-eviction-from-osi_TryEvictVCache.patch --- openafs-1.6.18.3/debian/patches/LINUX-split-dentry-eviction-from-osi_TryEvictVCache.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/LINUX-split-dentry-eviction-from-osi_TryEvictVCache.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,164 @@ +From cb2e2c26dc841bb4cab2d3b2ff376936f6c39e68 Mon Sep 17 00:00:00 2001 +From: Mark Vitale +Date: Thu, 4 Aug 2016 18:18:15 -0400 +Subject: LINUX: split dentry eviction from osi_TryEvictVCache + +To make osi_TryEvictVCache clearer, and to prepare for a future change +in dentry eviction, split the dentry eviction logic into its own routine +osi_TryEvictDentries. + +No functional difference should be incurred by this commit. + +Reviewed-on: https://gerrit.openafs.org/12362 +Reviewed-by: Benjamin Kaduk +Tested-by: BuildBot +Reviewed-by: Joe Gorse +(cherry picked from commit 742643e306929ac979ab69515a33ee2a3f2fa3fa) + +Change-Id: I750fc7606ca56e784a60bdbc13a32d21fe307429 +--- + src/afs/LINUX/osi_vcache.c | 103 +++++++++++++++++++++++++-------------------- + 1 file changed, 57 insertions(+), 46 deletions(-) + +diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c +index 8a0c57899..3682bdc29 100644 +--- a/src/afs/LINUX/osi_vcache.c ++++ b/src/afs/LINUX/osi_vcache.c +@@ -15,77 +15,88 @@ + + #include "osi_compat.h" + +-int +-osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) { +- int code; +- ++void ++osi_TryEvictDentries(struct vcache *avc) ++{ + struct dentry *dentry; + struct inode *inode = AFSTOV(avc); + #if defined(D_ALIAS_IS_HLIST) && !defined(HLIST_ITERATOR_NO_NODE) + struct hlist_node *p; + #endif + +- /* First, see if we can evict the inode from the dcache */ +- if (defersleep && avc != afs_globalVp && VREFCOUNT(avc) > 1 && avc->opens == 0) { +- *slept = 1; +- AFS_FAST_HOLD(avc); +- ReleaseWriteLock(&afs_xvcache); +- AFS_GUNLOCK(); +- + #if defined(HAVE_DCACHE_LOCK) +- spin_lock(&dcache_lock); ++ spin_lock(&dcache_lock); + + restart: +- list_for_each_entry(dentry, &inode->i_dentry, d_alias) { +- if (d_unhashed(dentry)) +- continue; +- dget_locked(dentry); +- +- spin_unlock(&dcache_lock); +- if (d_invalidate(dentry) == -EBUSY) { +- dput(dentry); +- /* perhaps lock and try to continue? (use cur as head?) */ +- goto inuse; +- } ++ list_for_each_entry(dentry, &inode->i_dentry, d_alias) { ++ if (d_unhashed(dentry)) ++ continue; ++ dget_locked(dentry); ++ ++ spin_unlock(&dcache_lock); ++ if (d_invalidate(dentry) == -EBUSY) { + dput(dentry); +- spin_lock(&dcache_lock); +- goto restart; ++ /* perhaps lock and try to continue? (use cur as head?) */ ++ goto inuse; + } +- spin_unlock(&dcache_lock); ++ dput(dentry); ++ spin_lock(&dcache_lock); ++ goto restart; ++ } ++ spin_unlock(&dcache_lock); + #else /* HAVE_DCACHE_LOCK */ +- spin_lock(&inode->i_lock); ++ spin_lock(&inode->i_lock); + + restart: + #if defined(D_ALIAS_IS_HLIST) + # if defined(HLIST_ITERATOR_NO_NODE) +- hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { ++ hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { + # else +- hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) { ++ hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) { + # endif + #else +- list_for_each_entry(dentry, &inode->i_dentry, d_alias) { ++ list_for_each_entry(dentry, &inode->i_dentry, d_alias) { + #endif +- spin_lock(&dentry->d_lock); +- if (d_unhashed(dentry)) { +- spin_unlock(&dentry->d_lock); +- continue; +- } ++ spin_lock(&dentry->d_lock); ++ if (d_unhashed(dentry)) { + spin_unlock(&dentry->d_lock); +- dget(dentry); +- +- spin_unlock(&inode->i_lock); +- if (afs_d_invalidate(dentry) == -EBUSY) { +- dput(dentry); +- /* perhaps lock and try to continue? (use cur as head?) */ +- goto inuse; +- } +- dput(dentry); +- spin_lock(&inode->i_lock); +- goto restart; ++ continue; + } ++ spin_unlock(&dentry->d_lock); ++ dget(dentry); ++ + spin_unlock(&inode->i_lock); ++ if (afs_d_invalidate(dentry) == -EBUSY) { ++ dput(dentry); ++ /* perhaps lock and try to continue? (use cur as head?) */ ++ goto inuse; ++ } ++ dput(dentry); ++ spin_lock(&inode->i_lock); ++ goto restart; ++ } ++ spin_unlock(&inode->i_lock); + #endif /* HAVE_DCACHE_LOCK */ + inuse: ++ return; ++} ++ ++ ++int ++osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) ++{ ++ int code; ++ ++ /* First, see if we can evict the inode from the dcache */ ++ if (defersleep && avc != afs_globalVp && VREFCOUNT(avc) > 1 ++ && avc->opens == 0) { ++ *slept = 1; ++ AFS_FAST_HOLD(avc); ++ ReleaseWriteLock(&afs_xvcache); ++ AFS_GUNLOCK(); ++ ++ osi_TryEvictDentries(avc); ++ + AFS_GLOCK(); + ObtainWriteLock(&afs_xvcache, 733); + AFS_FAST_RELE(avc); +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/Reformat-src-afs-LINUX-osi_vcache.c.patch openafs-1.6.20/debian/patches/Reformat-src-afs-LINUX-osi_vcache.c.patch --- openafs-1.6.18.3/debian/patches/Reformat-src-afs-LINUX-osi_vcache.c.patch 1970-01-01 00:00:00.000000000 +0000 +++ openafs-1.6.20/debian/patches/Reformat-src-afs-LINUX-osi_vcache.c.patch 2016-12-01 05:13:27.000000000 +0000 @@ -0,0 +1,89 @@ +From f31b673509664714b146f23be069b69be7e1ac89 Mon Sep 17 00:00:00 2001 +From: Benjamin Kaduk +Date: Thu, 27 Oct 2016 17:27:26 -0500 +Subject: Reformat src/afs/LINUX/osi_vcache.c + +Apply the GNU indent options from CODING, with manual adjustments +to leave jump labels in column zero. + +Also rename and mark static a function-local helper function. + +Reviewed-on: https://gerrit.openafs.org/12422 +Reviewed-by: Benjamin Kaduk +Tested-by: BuildBot +(cherry picked from commit 22933e02e2510f25b79230964f135571c7bfe710) + +Change-Id: I9fb2886ae2213218ae80ea9d5b80540b9c79077b +--- + src/afs/LINUX/osi_vcache.c | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c +index 3682bdc29..bc74b6744 100644 +--- a/src/afs/LINUX/osi_vcache.c ++++ b/src/afs/LINUX/osi_vcache.c +@@ -10,13 +10,13 @@ + #include + #include "afs/param.h" + +-#include "afs/sysincludes.h" /*Standard vendor system headers */ +-#include "afsincludes.h" /*AFS-based standard headers */ ++#include "afs/sysincludes.h" /*Standard vendor system headers */ ++#include "afsincludes.h" /*AFS-based standard headers */ + + #include "osi_compat.h" + +-void +-osi_TryEvictDentries(struct vcache *avc) ++static void ++TryEvictDentries(struct vcache *avc) + { + struct dentry *dentry; + struct inode *inode = AFSTOV(avc); +@@ -95,7 +95,7 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) + ReleaseWriteLock(&afs_xvcache); + AFS_GUNLOCK(); + +- osi_TryEvictDentries(avc); ++ TryEvictDentries(avc); + + AFS_GLOCK(); + ObtainWriteLock(&afs_xvcache, 733); +@@ -103,7 +103,7 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) + } + + /* See if we can evict it from the VLRUQ */ +- if (VREFCOUNT_GT(avc,0) && !VREFCOUNT_GT(avc,1) && avc->opens == 0 ++ if (VREFCOUNT_GT(avc, 0) && !VREFCOUNT_GT(avc, 1) && avc->opens == 0 + && (avc->f.states & CUnlinkedDel) == 0) { + int didsleep = *slept; + +@@ -145,17 +145,22 @@ osi_NewVnode(void) + } + + void +-osi_PrePopulateVCache(struct vcache *avc) { ++osi_PrePopulateVCache(struct vcache *avc) ++{ + avc->uncred = 0; + memset(&(avc->f), 0, sizeof(struct fvcache)); + avc->cred = NULL; + } + + void +-osi_AttachVnode(struct vcache *avc, int seq) { /* Nada */ } ++osi_AttachVnode(struct vcache *avc, int seq) ++{ ++ /* Nada */ ++} + + void +-osi_PostPopulateVCache(struct vcache *avc) { ++osi_PostPopulateVCache(struct vcache *avc) ++{ + vSetType(avc, VREG); + } + +-- +2.11.0 + diff -Nru openafs-1.6.18.3/debian/patches/series openafs-1.6.20/debian/patches/series --- openafs-1.6.18.3/debian/patches/series 2016-08-03 20:50:06.000000000 +0000 +++ openafs-1.6.20/debian/patches/series 2016-12-01 05:13:27.000000000 +0000 @@ -1 +1,8 @@ 0003-Add-dummy-exit-command-for-afsd-to-do-nothing.patch +LINUX-split-dentry-eviction-from-osi_TryEvictVCache.patch +Reformat-src-afs-LINUX-osi_vcache.c.patch +LINUX-do-not-use-d_invalidate-to-evict-dentries.patch +afs-shake-harder-in-shake-loose-vcaches.patch +Linux-4.9-deal-with-demise-of-GROUP_AT.patch +Linux-4.9-inode_operation-rename-now-takes-flags.patch +Linux-4.9-inode_change_ok-becomes-setattr_prepare.patch diff -Nru openafs-1.6.18.3/debian/po/zh_CN.po openafs-1.6.20/debian/po/zh_CN.po --- openafs-1.6.18.3/debian/po/zh_CN.po 2016-08-03 20:50:06.000000000 +0000 +++ openafs-1.6.20/debian/po/zh_CN.po 2016-11-30 09:42:36.000000000 +0000 @@ -1,7 +1,7 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Simplified Chinese translation of openafs debconf messages. +# Copyright (C) 2007 Chun Tian +# This file is distributed under the same license as the openafs package. +# Chun Tian , 2007. # #, fuzzy msgid "" @@ -11,8 +11,8 @@ "POT-Creation-Date: 2013-04-08 11:17-0700\n" "PO-Revision-Date: 2009-02-13 09:25-0800\n" "Last-Translator: Chun Tian (binghe) \n" -"Language-Team: Internationalization \n" -"Language: \n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff -Nru openafs-1.6.18.3/debian/rules openafs-1.6.20/debian/rules --- openafs-1.6.18.3/debian/rules 2016-08-04 19:48:32.000000000 +0000 +++ openafs-1.6.20/debian/rules 2016-12-01 05:15:19.000000000 +0000 @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# Enable hardening flags in hardening-wrapper. This is a temporary -# workaround until upstream supports using user-provided CFLAGS, CPPFLAGS, -# and LDFLAGS. -export DEB_BUILD_HARDENING = 1 - # Tell Autoconf the correct system types. DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) @@ -94,6 +89,9 @@ # Handle the renaming of the up man page to afs-up here since the man pages # are generated from POD source by regen.sh. +# +# As a temporary workaround until upstream supports using +# user-provided CFLAGS, CPPFLAGS, and LDFLAGS, we pass these via CC. override_dh_auto_configure: @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi echo '$(DEBIAN)'-debian > .version @@ -102,7 +100,7 @@ sh regen.sh afslogsdir=/var/log/openafs afslocaldir=/var/lib/openafs/local \ sh configure \ - CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \ + CC='$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)' \ --with-afs-sysname=$(SYS_NAME) --disable-kernel-module \ --prefix=/usr --mandir=\$${prefix}/share/man \ --sysconfdir=/etc --libexecdir=/usr/lib --with-krb5 \ @@ -199,6 +197,7 @@ && rm Doxyfile *.h && mv html/* . && rm -r latex html \ && cd $(CURDIR) ; \ done + dh_doxygen -popenafs-doc install -d debian/$(srcpkg)/usr/src/modules/$(package) cd libafs_tree && find . -print \ @@ -251,16 +250,8 @@ chmod 700 debian/openafs-dbserver/var/lib/openafs/db chmod 700 debian/openafs-fileserver/var/lib/openafs/local -# Only include debugging information for the servers installed into -# /usr/lib/openafs rather than for all binaries. The servers are where -# debugging backtraces really matter, and a 10MB debugging package is -# overkill. override_dh_strip: - dh_strip --dbg-package=openafs-dbg - rm -rf debian/openafs-dbg/usr/lib/debug/lib - rm -rf debian/openafs-dbg/usr/lib/debug/sbin - rm -rf debian/openafs-dbg/usr/lib/debug/usr/bin - rm -rf debian/openafs-dbg/usr/lib/debug/usr/sbin + dh_strip --dbgsym-migration='openafs-dbg (<< 1.6.18.3-3~)' override_dh_builddeb: dh_builddeb -- -Zxz diff -Nru openafs-1.6.18.3/debian/source/lintian-overrides openafs-1.6.20/debian/source/lintian-overrides --- openafs-1.6.18.3/debian/source/lintian-overrides 2016-08-03 20:50:06.000000000 +0000 +++ openafs-1.6.20/debian/source/lintian-overrides 2016-11-30 09:42:36.000000000 +0000 @@ -3,3 +3,4 @@ # Upstream has dual-licensed these files under the IETF license and an # all-permissive license. See the prefix of the file. openafs source: license-problem-non-free-RFC-BCP78 doc/protocol/rfc5864.txt +openafs source: license-problem-non-free-RFC-BCP78 debian/copyright diff -Nru openafs-1.6.18.3/doc/xml/QuickStartUnix/appendix.xml openafs-1.6.20/doc/xml/QuickStartUnix/appendix.xml --- openafs-1.6.18.3/doc/xml/QuickStartUnix/appendix.xml 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/doc/xml/QuickStartUnix/appendix.xml 2016-11-30 20:06:42.000000000 +0000 @@ -98,7 +98,7 @@ becomes - # kinit admin + # klog admin Password: admin_passwd diff -Nru openafs-1.6.18.3/NEWS openafs-1.6.20/NEWS --- openafs-1.6.18.3/NEWS 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/NEWS 2016-11-30 20:06:42.000000000 +0000 @@ -1,4 +1,37 @@ User-Visible OpenAFS Changes +OpenAFS 1.6.20 (Security Release) + + All platforms + + * Fix for OPENAFS-SA-2016-003: file and directory names leak due to + reuse of directory objects without zeroing the contents + (12461 12462 12463 12464 12465) + +OpenAFS 1.6.19 + + All platforms + + * Documentation improvements (12304) + * Fixes for test failures (12396 12415) + + All DB server platforms + + * Avoid potentially writing to an out of date volume location or protection + database, or losing a database write, which could happen in rare cases + under special conditions during database leader election + (12339 12389) + + Solaris clients + + * Allow the fsinfo::: DTrace provider to work with AFS files (12371) + + Linux clients + + * Don't commit more data to a file than was actually copied during writes, + which could happen on architectures with a page size > 4 KiB (12413) + * Fixed build on PPC64 with GCC 6.1 (12388) (RT #133407) + * Fixed build on x86_64 with recent GCC (12365 12366) + OpenAFS 1.6.18.3 diff -Nru openafs-1.6.18.3/src/afs/afs_analyze.c openafs-1.6.20/src/afs/afs_analyze.c --- openafs-1.6.18.3/src/afs/afs_analyze.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/afs_analyze.c 2016-11-30 20:06:42.000000000 +0000 @@ -282,8 +282,8 @@ * afs_ClearStatus * * Description: - * Analyze the outcome of an RPC operation, taking whatever support - * actions are necessary. + * Clear any cached status for the target FID of a failed fileserver + * write RPC. * * Arguments: * afid : The FID of the file involved in the action. This argument @@ -395,6 +395,7 @@ * * Arguments: * aconn : Ptr to the relevant connection on which the call was made. + * rxconn: Ptr to the rx_connection * acode : The return code experienced by the RPC. * afid : The FID of the file involved in the action. This argument * may be null if none was involved. diff -Nru openafs-1.6.18.3/src/afs/afs_buffer.c openafs-1.6.20/src/afs/afs_buffer.c --- openafs-1.6.18.3/src/afs/afs_buffer.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/afs_buffer.c 2016-11-30 20:06:42.000000000 +0000 @@ -368,6 +368,8 @@ AFS_STATS(afs_stats_cmperf.bufFlushDirty++); } + /* Zero out the data so we don't leak something we shouldn't. */ + memset(lp->data, 0, AFS_BUFFER_PAGESIZE); /* Now fill in the header. */ lp->fid = adc->index; afs_copy_inode(&lp->inode, &adc->f.inode); diff -Nru openafs-1.6.18.3/src/afs/afs_call.c openafs-1.6.20/src/afs/afs_call.c --- openafs-1.6.18.3/src/afs/afs_call.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/afs_call.c 2016-11-30 20:06:42.000000000 +0000 @@ -86,10 +86,6 @@ static int afscall_set_rxpck_received = 0; -#if defined(AFS_HPUX_ENV) -extern int afs_vfs_mount(); -#endif /* defined(AFS_HPUX_ENV) */ - /* This is code which needs to be called once when the first daemon enters * the client. A non-zero return means an error and AFS should not start. */ @@ -912,12 +908,6 @@ osi_Assert(tbuffer1 != NULL); code = afs_InitDynroot(); if (!code) { -#if 0 - /* wait for basic init - XXX can't find any reason we need this? */ - while (afs_initState < AFSOP_START_BKG) - afs_osi_Sleep(&afs_initState); -#endif - AFS_COPYIN(AFSKPTR(parm2), (caddr_t)tcell->hosts, sizeof(tcell->hosts), code); } @@ -1245,22 +1235,6 @@ if (!code) AFS_COPYOUT((caddr_t) & mtu, AFSKPTR(parm3), sizeof(afs_int32), code); -#ifdef AFS_AIX32_ENV -/* this is disabled for now because I can't figure out how to get access - * to these kernel variables. It's only for supporting user-mode rx - * programs -- it makes a huge difference on the 220's in my testbed, - * though I don't know why. The bosserver does this with /etc/no, so it's - * being handled a different way for the servers right now. */ -/* { - static adjusted = 0; - extern u_long sb_max_dflt; - if (!adjusted) { - adjusted = 1; - if (sb_max_dflt < 131072) sb_max_dflt = 131072; - if (sb_max < 131072) sb_max = 131072; - } - } */ -#endif /* AFS_AIX32_ENV */ } else if (parm == AFSOP_GETMASK) { /* parm2 == addr in net order */ afs_uint32 mask = 0; #if !defined(AFS_SUN5_ENV) diff -Nru openafs-1.6.18.3/src/afs/afs_disconnected.c openafs-1.6.20/src/afs/afs_disconnected.c --- openafs-1.6.18.3/src/afs/afs_disconnected.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/afs_disconnected.c 2016-11-30 20:06:42.000000000 +0000 @@ -702,7 +702,8 @@ ttargetName = afs_osi_Alloc(tlen); if (!ttargetName) { afs_PutDCache(tdc); - return ENOMEM; + code = ENOMEM; + goto end; } ObtainReadLock(&tdc->lock); tfile = afs_CFileOpen(&tdc->f.inode); diff -Nru openafs-1.6.18.3/src/afs/LINUX/osi_machdep.h openafs-1.6.20/src/afs/LINUX/osi_machdep.h --- openafs-1.6.18.3/src/afs/LINUX/osi_machdep.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/LINUX/osi_machdep.h 2016-11-30 20:06:42.000000000 +0000 @@ -111,7 +111,12 @@ #define VN_RELE(V) iput((V)) #define afs_suser(x) capable(CAP_SYS_ADMIN) -#define wakeup afs_osi_Wakeup +extern int afs_osi_Wakeup(void *event); +static inline void +wakeup(void *event) +{ + afs_osi_Wakeup(event); +} #define vType(V) ((AFSTOV((V)))->i_mode & S_IFMT) #define vSetType(V, type) AFSTOV((V))->i_mode = ((type) | (AFSTOV((V))->i_mode & ~S_IFMT)) /* preserve mode */ @@ -133,8 +138,8 @@ #define copyout(F, T, C) (copy_to_user ((char*)(T), (char*)(F), (C)) > 0 ? EFAULT : 0) /* kernel print statements */ -#define printf printk -#define uprintf printk +#define printf(args...) printk(args) +#define uprintf(args...) printk(args) #ifndef NGROUPS diff -Nru openafs-1.6.18.3/src/afs/LINUX/osi_syscall.c openafs-1.6.20/src/afs/LINUX/osi_syscall.c --- openafs-1.6.18.3/src/afs/LINUX/osi_syscall.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/LINUX/osi_syscall.c 2016-11-30 20:06:42.000000000 +0000 @@ -461,8 +461,8 @@ flush_cache((void *)afs_sys_call_table, 2*NR_syscalls*sizeof(void*)); - sys_setgroupsp = sys_setgroups_stub; - sys32_setgroupsp = sys32_setgroups_stub; + sys_setgroupsp = POINTER2SYSCALL sys_setgroups_stub; + sys32_setgroupsp = POINTER2SYSCALL sys32_setgroups_stub; } /***** COMMON (except IA64 or PPC64) *****/ #else /* !AFS_IA64_LINUX20_ENV */ diff -Nru openafs-1.6.18.3/src/afs/LINUX/osi_vnodeops.c openafs-1.6.20/src/afs/LINUX/osi_vnodeops.c --- openafs-1.6.18.3/src/afs/LINUX/osi_vnodeops.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/LINUX/osi_vnodeops.c 2016-11-30 20:06:42.000000000 +0000 @@ -2957,7 +2957,7 @@ int code; unsigned int from = pos & (PAGE_SIZE - 1); - code = afs_linux_commit_write(file, page, from, from + len); + code = afs_linux_commit_write(file, page, from, from + copied); unlock_page(page); put_page(page); diff -Nru openafs-1.6.18.3/src/afs/SOLARIS/osi_vfsops.c openafs-1.6.20/src/afs/SOLARIS/osi_vfsops.c --- openafs-1.6.18.3/src/afs/SOLARIS/osi_vfsops.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/afs/SOLARIS/osi_vfsops.c 2016-11-30 20:06:42.000000000 +0000 @@ -481,7 +481,7 @@ VFSDEF_VERSION, "afs", afsinit, - 0, + VSW_STATS, NULL }; #else @@ -489,7 +489,7 @@ VFSDEF_VERSION, "afs", afsinit, - 0 + VSW_STATS }; #endif #else diff -Nru openafs-1.6.18.3/src/bozo/bos.c openafs-1.6.20/src/bozo/bos.c --- openafs-1.6.18.3/src/bozo/bos.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/bozo/bos.c 2016-11-30 20:06:42.000000000 +0000 @@ -1562,9 +1562,18 @@ for (i = MRAFS_OFFSET; i < ADDPARMOFFSET; i++) { if (as->parms[i].items) { - printf(" %s only possible for MR-AFS fileserver.\n", - as->parms[i].name); - stop = 1; + if (i == MRAFS_OFFSET + 5) { /* -salvagedirs */ + if (as->parms[4].items) { /* -all */ + mrafsParm.Optsalvagedirs = 1; /* Let this one slide. */ + } else { + printf(" -salvagedirs only possible with -all.\n"); + stop = 1; + } + } else { + printf(" %s only possible for MR-AFS fileserver.\n", + as->parms[i].name); + stop = 1; + } } } if (stop) diff -Nru openafs-1.6.18.3/src/butc/afsxbsa.c openafs-1.6.20/src/butc/afsxbsa.c --- openafs-1.6.18.3/src/butc/afsxbsa.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/afsxbsa.c 2016-11-30 20:06:42.000000000 +0000 @@ -17,13 +17,17 @@ #include +#include + #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX26_ENV) #include #endif #include +#include #include "butc_xbsa.h" #include +#include "butc_internal.h" /* Global Definations */ #define APPLTYPE "afs-butc" @@ -32,7 +36,7 @@ #define NOHANDLE 0 #define XAPI_FSINFO "FS for XOpen API" #define DIR_DELIMITER '/' -#define STR_DIR_DELIMITER '/' +#define STR_DIR_DELIMITER "/" xGlobal xopenGbl; char traceStr[DSM_MAX_RC_MSG_LENGTH+1]; @@ -199,7 +203,6 @@ { dsmLogExIn_t dsmLogIn; dsmLogExOut_t dsmLogOut; - dsInt16_t rc = 0; memset(&dsmLogOut, '\0', sizeof(dsmLogExOut_t)); if (dsmHandle) @@ -210,7 +213,7 @@ strcpy(dsmLogIn.appMsgID, appMsg); dsmLogIn.message = message; - rc = AFSdsmLogEventEx(dsmHandle, &dsmLogIn, &dsmLogOut); + AFSdsmLogEventEx(dsmHandle, &dsmLogIn, &dsmLogOut); } } @@ -641,7 +644,7 @@ } -afs_int32 dsm_MountLibrary() +afs_int32 dsm_MountLibrary(void) { void * dynlib = NULL ; @@ -989,7 +992,7 @@ strcat(msg, ".\n"); - sprintf(traceStr, msg); + strcpy(traceStr, msg); } *BSAHandleP = (long)dsmHandle; @@ -1082,7 +1085,7 @@ } dsmHandle = BSAHandle; - sprintf(traceStr2, "BSATerminate ENTRY: BSAHandle is %d.", + sprintf(traceStr2, "BSATerminate ENTRY: BSAHandle is %ld.", BSAHandle); ourTrace(dsmHandle, TrFL, traceStr2); @@ -1121,8 +1124,8 @@ dsmHandle = BSAHandle; - sprintf(traceStr2, "BSAChangeToken ENTRY: BSAHandle:%d old:>%s< new:>%s<", - BSAHandle,oldTokenP,newTokenP); + sprintf(traceStr2, "BSAChangeToken ENTRY: BSAHandle:%ld old:>%s< new:>%s<", + BSAHandle,*oldTokenP,*newTokenP); ourTrace(dsmHandle, TrFL, traceStr2); rc = AFSdsmChangePW(dsmHandle, (char *)oldTokenP, (char *)newTokenP); @@ -1172,7 +1175,7 @@ #endif } - sprintf(traceStr2, "BSASetEnvironment ENTRY: BSAHandle:%d envP:>%p< ", + sprintf(traceStr2, "BSASetEnvironment ENTRY: BSAHandle:%ld envP:>%p< ", BSAHandle,envP); ourTrace(BSAHandle, TrFL, traceStr2); XOPENRETURN(BSAHandle,"BSASetEnvironment", @@ -1191,7 +1194,7 @@ char envString[ADSM_ENV_STRS][BSA_MAX_DESC]; char maxObjStr[6]; /* conversion field. value range is 16-256 */ dsUint32_t maxObjNum; - dsInt16_t i, j; + dsInt16_t i; if(!dsm_init) { @@ -1212,7 +1215,7 @@ { memset(envString[i], 0x00, BSA_MAX_DESC); } - sprintf(traceStr2, "BSAGetEnvironment ENTRY: BSAHandle:%d ObjOwner:'%s' appOwner:'%s' envP:>%p<.", + sprintf(traceStr2, "BSAGetEnvironment ENTRY: BSAHandle:%ld ObjOwner:'%s' appOwner:'%s' envP:>%p<.", BSAHandle, objOwnerP->bsaObjectOwner, objOwnerP->appObjectOwner, @@ -1261,7 +1264,7 @@ strcpy(envString[1],"TSMMAXOBJ="); maxObjNum = xopenGbl.dsmSessInfo.maxObjPerTxn; /* convert to 32 bit */ - sprintf(maxObjStr,"%lu", maxObjNum ); + sprintf(maxObjStr,"%u", maxObjNum ); strcat(envString[1], maxObjStr); strcpy(envString[2], "TSMSRVRSTANZA="); @@ -1306,7 +1309,7 @@ #endif } - sprintf(traceStr2, "BSABeginTxn ENTRY: BSAHandle:%d", BSAHandle); + sprintf(traceStr2, "BSABeginTxn ENTRY: BSAHandle:%ld", BSAHandle); ourTrace(BSAHandle, TrFL, traceStr2); /*======================================================== don't actually issue BeginTxn yet, because we will do our @@ -1351,7 +1354,7 @@ memset(rsMsg, '\0', DSM_MAX_RC_MSG_LENGTH + 1); memset(ourMessage, '\0', DSM_MAX_RC_MSG_LENGTH + 1); - sprintf(traceStr2, "BSAEndTxn ENTRY: BSAHandle:%d Vote:>%d<", BSAHandle, vote); + sprintf(traceStr2, "BSAEndTxn ENTRY: BSAHandle:%ld Vote:>%d<", BSAHandle, vote); ourTrace(BSAHandle, TrFL, traceStr2); dsmHandle = BSAHandle; @@ -1496,7 +1499,7 @@ memset(&backupData, 0x00, sizeof(qryBackupData)); - sprintf(traceStr2, "BSAQueryObject ENTRY: BSAHandle:%d ObjOwner(qryDesc):'%s' appOwner(qryDesc):'%s' \n ObjName(qryDesc):'%.*s%.*s' \n copyType:%d ObjectType:%d status:%d ", + sprintf(traceStr2, "BSAQueryObject ENTRY: BSAHandle:%ld ObjOwner(qryDesc):'%s' appOwner(qryDesc):'%s' \n ObjName(qryDesc):'%.*s%.*s' \n copyType:%d ObjectType:%d status:%d ", BSAHandle, BSAqryDescP->owner.bsaObjectOwner, BSAqryDescP->owner.appObjectOwner, @@ -1546,7 +1549,7 @@ ====================================================*/ if (strlen(BSAqryDescP->objName.objectSpaceName) > BSA_MAX_OSNAME) { - sprintf(traceStr2, "BSAQueryObject: objectSpaceName too long (%d).", + sprintf(traceStr2, "BSAQueryObject: objectSpaceName too long (%" AFS_SIZET_FMT ").", strlen(BSAqryDescP->objName.objectSpaceName)); ourTrace(BSAHandle,TrFL, traceStr2); bsaRC = BSA_RC_OBJNAME_TOO_LONG; @@ -1560,7 +1563,7 @@ if (strlen(BSAqryDescP->objName.pathName) > min(DSM_MAX_HL_LENGTH, BSA_MAX_PATHNAME)) { - sprintf(traceStr2, "BSAQueryObject: pathName too long (%d)", + sprintf(traceStr2, "BSAQueryObject: pathName too long (%" AFS_SIZET_FMT ")", strlen(BSAqryDescP->objName.pathName)); ourTrace(BSAHandle, TrFL, traceStr2); bsaRC = BSA_RC_OBJNAME_TOO_LONG; @@ -1619,7 +1622,7 @@ if (strlen(BSAqryDescP->desc) > ADSM_MAX_DESC) { - sprintf(traceStr2, "BSAQueryObject: description longer than ADSM max (%d). ", strlen(BSAqryDescP->desc)); + sprintf(traceStr2, "BSAQueryObject: description longer than ADSM max (%" AFS_SIZET_FMT "). ", strlen(BSAqryDescP->desc)); ourTrace(BSAHandle,TrFL, traceStr2); bsaRC = BSA_RC_DESC_TOO_LONG; XOPENRETURN(BSAHandle, "BSAQueryObject", @@ -1815,7 +1818,7 @@ if (rc == DSM_RC_OK) { - sprintf(traceStr2, "BSAQueryObject(AFSdsmGetNextQObj) rc = %d, ObjOwner(objDesc):'%s' appOwner(objDesc):'%s' \n ObjName(objDesc):'%.*s%.*s' \n copyType:%d copyId:'%d %d' cGName:'%s'", + sprintf(traceStr2, "BSAQueryObject(AFSdsmGetNextQObj) rc = %d, ObjOwner(objDesc):'%s' appOwner(objDesc):'%s' \n ObjName(objDesc):'%.*s%.*s' \n copyType:%d copyId:'%lu %lu' cGName:'%s'", rc, BSAobjDescP->Owner.bsaObjectOwner, BSAobjDescP->Owner.appObjectOwner, @@ -1824,7 +1827,7 @@ BSAobjDescP->copyType, BSAobjDescP->copyId.left, BSAobjDescP->copyId.right, - BSAobjDescP->cGName == NULL ? "" : BSAobjDescP->cGName); + BSAobjDescP->cGName); ourTrace(BSAHandle,TrFL, traceStr2); } @@ -1840,7 +1843,6 @@ ) { dsInt16_t rc = 0; - dsInt16_t rc1 = 0; BSA_Int16 bsaRC = 0; dsUint32_t dsmHandle; DataBlk getBlk; @@ -1871,7 +1873,7 @@ memset(errPrefix, '\0', DSM_MAX_RC_MSG_LENGTH + 1); memset(ourMessage, '\0', DSM_MAX_RC_MSG_LENGTH + 1); - sprintf(traceStr2, "BSAGetObject ENTRY: BSAHandle:%d version:%d copyType:%d copyId:'%d %d' \n bufferLen:%d numBytes:%d ", + sprintf(traceStr2, "BSAGetObject ENTRY: BSAHandle:%ld version:%lu copyType:%d copyId:'%lu %lu' \n bufferLen:%d numBytes:%d ", BSAHandle, BSAobjDescP->version, BSAobjDescP->copyType, @@ -1885,7 +1887,7 @@ if (BSAobjDescP->version != ObjectDescriptorVersion) { - sprintf(traceStr2,"Warning: BSAGetObject: objectDesc.version unexpected %d.", BSAobjDescP->version); + sprintf(traceStr2,"Warning: BSAGetObject: objectDesc.version unexpected %lu.", BSAobjDescP->version); ourTrace(BSAHandle,TrFL, traceStr2); /*================================================================== don't treat this as an error now since it isn't defined in the spec @@ -1966,8 +1968,8 @@ else { /*=== appl may call BSAEndData to clean up trxn but don't count on it... ===*/ - rc1 = AFSdsmEndGetObj(dsmHandle); - rc1 = AFSdsmEndGetData(dsmHandle); + AFSdsmEndGetObj(dsmHandle); + AFSdsmEndGetData(dsmHandle); xopenGbl.sessFlags = (xopenGbl.sessFlags | FL_END_DATA_DONE); /* turn flag on */ } @@ -1983,7 +1985,6 @@ ) { dsInt16_t rc = 0; - dsInt16_t rc1 = 0; BSA_Int16 bsaRC = 0; dsUint32_t dsmHandle; DataBlk getBlk; @@ -2006,7 +2007,7 @@ dsmHandle = BSAHandle; - sprintf(traceStr2, "BSAGetData ENTRY: BSAHandle:%d, bufferLen:%d, numBytes:%d", + sprintf(traceStr2, "BSAGetData ENTRY: BSAHandle:%ld, bufferLen:%d, numBytes:%d", BSAHandle, BSAdataBlockP->bufferLen, BSAdataBlockP->numBytes); @@ -2037,8 +2038,8 @@ ourTrace(BSAHandle, TrFL,traceStr2); /*=== appl may call BSAEndData to clean up trxn but don't count on it... ===*/ - rc1 = AFSdsmEndGetObj(dsmHandle); - rc1 = AFSdsmEndGetData(dsmHandle); + AFSdsmEndGetObj(dsmHandle); + AFSdsmEndGetData(dsmHandle); xopenGbl.sessFlags = (xopenGbl.sessFlags | FL_END_DATA_DONE); /* turn flag on */ } @@ -2075,7 +2076,7 @@ dsmHandle = BSAHandle; - sprintf(traceStr2, "BSASendData ENTRY: BSAHandle:%d bufferLen: %d numBytes: %d ", + sprintf(traceStr2, "BSASendData ENTRY: BSAHandle:%ld bufferLen: %d numBytes: %d ", BSAHandle, BSAdataBlockP->bufferLen, BSAdataBlockP->numBytes); @@ -2101,7 +2102,7 @@ xopenGbl.sessFlags = (xopenGbl.sessFlags | FL_RC_WILL_ABORT); } BSAdataBlockP->numBytes = (BSA_UInt16)dataBlkArea.numBytes; - sprintf(traceStr2, "BSASendData(AFSdsmSendData): BSAHandle:%d bufferLen: %d numBytes sent: %d ", + sprintf(traceStr2, "BSASendData(AFSdsmSendData): BSAHandle:%ld bufferLen: %d numBytes sent: %d ", BSAHandle, BSAdataBlockP->bufferLen, BSAdataBlockP->numBytes); @@ -2117,7 +2118,6 @@ ) { dsInt16_t rc = 0; - dsInt16_t rc1 = 0; BSA_Int16 bsaRC = 0; dsUint32_t dsmHandle; @@ -2139,7 +2139,7 @@ dsmHandle = BSAHandle; - sprintf(traceStr2, "BSAEndData ENTRY: BSAHandle:%d", BSAHandle); + sprintf(traceStr2, "BSAEndData ENTRY: BSAHandle:%ld", BSAHandle); ourTrace(BSAHandle,TrFL, traceStr2); /*======================================================= @@ -2246,7 +2246,7 @@ if (BSAobjDescP != NULL && BSAdataBlockP != NULL) { - sprintf(traceStr2, "BSACreateObject ENTRY: BSAHandle:%d ObjOwner:'%s' appOwner:'%s' \n ObjName:'%.*s%.*s' \n objType:%d size:'%d %d' resourceType:'%s' \n bufferLen:%d numBytes:%d ", + sprintf(traceStr2, "BSACreateObject ENTRY: BSAHandle:%ld ObjOwner:'%s' appOwner:'%s' \n ObjName:'%.*s%.*s' \n objType:%d size:'%lu %lu' resourceType:'%s' \n bufferLen:%d numBytes:%d ", BSAHandle, BSAobjDescP->Owner.bsaObjectOwner[0] != '\0' ? BSAobjDescP->Owner.bsaObjectOwner : "", @@ -2269,7 +2269,7 @@ XOPENRETURN(BSAHandle, "BSACreateObject", bsaRC,__FILE__,__LINE__); } - sprintf(traceStr2, "BSACreateObject ENTRY: BSAHandle:%d", BSAHandle); + sprintf(traceStr2, "BSACreateObject ENTRY: BSAHandle:%ld", BSAHandle); } ourTrace(BSAHandle, TrFL, traceStr2); @@ -2304,7 +2304,7 @@ /*=== check string lengths - if this too long, it won't fit in our objInfo ===*/ if (strlen(BSAobjDescP->desc) > ADSM_MAX_DESC) { - sprintf(traceStr2,"BSACreateObject: description longer than TSM max (%d). ", + sprintf(traceStr2,"BSACreateObject: description longer than TSM max (%" AFS_SIZET_FMT "). ", strlen(BSAobjDescP->desc)); ourTrace(BSAHandle, TrFL, traceStr2); bsaRC = BSA_RC_DESC_TOO_LONG; @@ -2313,7 +2313,7 @@ } if (strlen(BSAobjDescP->objectInfo) > ADSM_MAX_OBJINFO) { - sprintf(traceStr2,"BSACreateObject: objInfo longer than TSM max (%d).", + sprintf(traceStr2,"BSACreateObject: objInfo longer than TSM max (%" AFS_SIZET_FMT ").", strlen(BSAobjDescP->objectInfo)); ourTrace(BSAHandle,TrFL, traceStr2); bsaRC = BSA_RC_OBJINFO_TOO_LONG; @@ -2332,7 +2332,7 @@ if (strlen(BSAobjDescP->objName.objectSpaceName) > BSA_MAX_OSNAME) { - sprintf(traceStr2, "BSACreateObject: objectSpaceName too long (%d)", + sprintf(traceStr2, "BSACreateObject: objectSpaceName too long (%" AFS_SIZET_FMT ")", strlen(BSAobjDescP->objName.objectSpaceName)); ourTrace(BSAHandle, TrFL, traceStr2); bsaRC = BSA_RC_OBJNAME_TOO_LONG; @@ -2448,7 +2448,7 @@ if (strlen(BSAobjDescP->objName.pathName) > min(DSM_MAX_HL_LENGTH, BSA_MAX_PATHNAME)) { - sprintf(traceStr2, "BSACreateObject: pathName too long (%d)", + sprintf(traceStr2, "BSACreateObject: pathName too long (%" AFS_SIZET_FMT ")", strlen(BSAobjDescP->objName.pathName)); ourTrace(BSAHandle,TrFL, traceStr2); bsaRC = BSA_RC_OBJNAME_TOO_LONG; @@ -2602,7 +2602,7 @@ dsmHandle = BSAHandle; - sprintf(traceStr2, "BSADeleteObject ENTRY: BSAHandle:%d CopyType:%d \n ObjName:'%.*s%.*s' copyidP:'%d %d'.", + sprintf(traceStr2, "BSADeleteObject ENTRY: BSAHandle:%ld CopyType:%d \n ObjName:'%.*s%.*s' copyidP:'%lu %lu'.", BSAHandle, copyType, 100,BSAobjNameP->objectSpaceName, @@ -2749,7 +2749,7 @@ memset(&delInfo, 0x00, sizeof(dsmDelInfo)); memset(&queryBuffer, 0x00, sizeof(qryBackupData)); - sprintf(traceStr2, "BSAMarkObjectInactive ENTRY: BSAHandle:%d \n ObjName:'%.*s%.*s'.", + sprintf(traceStr2, "BSAMarkObjectInactive ENTRY: BSAHandle:%ld \n ObjName:'%.*s%.*s'.", BSAHandle, 100, BSAobjNameP->objectSpaceName, 100, BSAobjNameP->pathName); @@ -2766,7 +2766,7 @@ if (strlen(BSAobjNameP->objectSpaceName) > DSM_MAX_FSNAME_LENGTH) { - sprintf(traceStr2, "BSAMarkObjectInactive: objectSpaceName too long (%d)", strlen(BSAobjNameP->objectSpaceName)); + sprintf(traceStr2, "BSAMarkObjectInactive: objectSpaceName too long (%" AFS_SIZET_FMT ")", strlen(BSAobjNameP->objectSpaceName)); ourTrace(BSAHandle,TrFL, traceStr2); bsaRC = BSA_RC_OBJNAME_TOO_LONG; @@ -2780,7 +2780,7 @@ if (strlen(BSAobjNameP->pathName) > min(DSM_MAX_HL_LENGTH, BSA_MAX_PATHNAME)) { - sprintf(traceStr2, "BSAMarkObjectInactive: pathName too long (%d)", + sprintf(traceStr2, "BSAMarkObjectInactive: pathName too long (%" AFS_SIZET_FMT ")", strlen(BSAobjNameP->pathName)); ourTrace(BSAHandle,TrFL, traceStr2); bsaRC = BSA_RC_OBJNAME_TOO_LONG; diff -Nru openafs-1.6.18.3/src/butc/afsxbsa.h openafs-1.6.20/src/butc/afsxbsa.h --- openafs-1.6.18.3/src/butc/afsxbsa.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/afsxbsa.h 2016-11-30 20:06:42.000000000 +0000 @@ -73,7 +73,6 @@ #define ADSM_ENV_STRS 3 /* number of env strings */ #define ObjectDescriptorVersion 1 /* ver for ObjectDescriptor */ #define UserDescriptorVersion 1 /* ver for UserDescriptor */ -#define BSAObjectType_DATABASE 4 /* ObjectType for Databases */ /* Return Codes Used */ @@ -331,7 +330,8 @@ typedef enum { BSAObjectType_ANY = 1, BSAObjectType_FILE = 2, - BSAObjectType_DIRECTORY = 3 + BSAObjectType_DIRECTORY = 3, + BSAObjectType_DATABASE = 4, } ObjectType; /* Operation diff -Nru openafs-1.6.18.3/src/butc/butc_internal.h openafs-1.6.20/src/butc/butc_internal.h --- openafs-1.6.18.3/src/butc/butc_internal.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/butc_internal.h 2016-11-30 20:06:42.000000000 +0000 @@ -21,10 +21,18 @@ extern afs_int32 finishDump(struct budb_dumpEntry *); extern afs_int32 threadEntryDir(void *, afs_int32, afs_int32); +/* dump.c */ +#ifdef xbsa +struct butx_transactionInfo; +extern afs_int32 InitToServer(afs_int32 taskId, struct butx_transactionInfo * butxInfoP, + char *server); +#endif + /* list.c */ extern afs_int32 allocTaskId(void); -/* lwps.h */ +/* lwps.c */ +extern void ELog(afs_int32 task, char *fmt, ...); extern int ReadLabel(struct tc_tapeLabel *); extern void unmountTape(afs_int32, struct butm_tapeInfo *); extern int tapeExpired(struct butm_tapeLabel *); diff -Nru openafs-1.6.18.3/src/butc/butc_xbsa.c openafs-1.6.20/src/butc/butc_xbsa.c --- openafs-1.6.18.3/src/butc/butc_xbsa.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/butc_xbsa.c 2016-11-30 20:06:42.000000000 +0000 @@ -20,10 +20,12 @@ #include #endif #include +#include #include "butc_xbsa.h" #include #include +#include "butc_internal.h" #include "error_macros.h" extern int debugLevel; @@ -65,6 +67,7 @@ BSA_Int16(*XBSAGetEnvironment) (BSA_UInt32, ObjectOwner *, char **); #endif +void xbsa_error(int rc, struct butx_transactionInfo *info) { switch (rc) { @@ -127,8 +130,9 @@ afs_int32 xbsa_MountLibrary(struct butx_transactionInfo *info, afs_int32 serverType) { +#ifndef NEW_XBSA void *dynlib; - int rc; +#endif if (debugLevel > 98) { printf("\nxbsa_MountLibraray\n"); @@ -379,7 +383,7 @@ } strcpy(info->objOwner.bsaObjectOwner, bsaObjectOwner); } else { - info->objOwner.bsaObjectOwner[0] = NULL; + info->objOwner.bsaObjectOwner[0] = '\0'; } if (appObjectOwner) { @@ -391,7 +395,7 @@ } strcpy(info->objOwner.appObjectOwner, appObjectOwner); } else { - info->objOwner.appObjectOwner[0] = NULL; + info->objOwner.appObjectOwner[0] = '\0'; } if (secToken) { @@ -403,7 +407,7 @@ } strcpy(info->secToken, secToken); } else { - info->secToken[0] = NULL; + info->secToken[0] = '\0'; } rc = (int)XBSAInit(&(info->bsaHandle), &(info->secToken), @@ -433,7 +437,7 @@ switch (XBSA_GET_SERVER_TYPE(info->serverType)) { case XBSA_SERVER_TYPE_ADSM: for (i = 0; i < XBSA_NUM_ENV_STRS; i++) { - if (strncmp(envP[i], ADSMMaxObject, sizeof(ADSMMaxObject)) == 0) { + if (strncmp(envP[i], ADSMMaxObject, strlen(ADSMMaxObject)) == 0) { tempStrPtr = envP[i]; tempStrPtr = tempStrPtr + strlen(ADSMMaxObject); info->maxObjects = strtol(tempStrPtr, NULL, 10); @@ -602,7 +606,7 @@ } strcpy(queryDescriptor.objName.objectSpaceName, objectSpaceName); } else { - queryDescriptor.objName.objectSpaceName[0] = NULL; + queryDescriptor.objName.objectSpaceName[0] = '\0'; } if (pathName) { @@ -614,7 +618,7 @@ } strcpy(queryDescriptor.objName.pathName, pathName); } else { - queryDescriptor.objName.pathName[0] = NULL; + queryDescriptor.objName.pathName[0] = '\0'; } queryDescriptor.owner = info->objOwner; @@ -744,7 +748,6 @@ char *objectInfo) { int rc; - int length; DataBlock dataBlock; if (debugLevel > 98) { @@ -777,7 +780,7 @@ } strcpy(info->curObject.objName.objectSpaceName, objectSpaceName); } else { - info->curObject.objName.objectSpaceName[0] = NULL; + info->curObject.objName.objectSpaceName[0] = '\0'; } if (pathName) { @@ -789,7 +792,7 @@ } strcpy(info->curObject.objName.pathName, pathName); } else { - info->curObject.objName.pathName[0] = NULL; + info->curObject.objName.pathName[0] = '\0'; } if (lGName) { @@ -801,7 +804,7 @@ } strcpy(info->curObject.lGName, lGName); } else { - info->curObject.lGName[0] = NULL; + info->curObject.lGName[0] = '\0'; } if (objectDescription) { @@ -817,7 +820,7 @@ } strcpy(info->curObject.desc, objectDescription); } else { - info->curObject.desc[0] = NULL; + info->curObject.desc[0] = '\0'; } if (objectInfo) { @@ -833,7 +836,7 @@ } strcpy(info->curObject.objectInfo, objectInfo); } else { - info->curObject.objectInfo[0] = NULL; + info->curObject.objectInfo[0] = '\0'; } if (info->numObjects == info->maxObjects) { @@ -911,7 +914,7 @@ } strcpy(objectName.objectSpaceName, objectSpaceName); } else { - objectName.objectSpaceName[0] = NULL; + objectName.objectSpaceName[0] = '\0'; } if (pathName) { @@ -922,7 +925,7 @@ } strcpy(objectName.pathName, pathName); } else { - objectName.pathName[0] = NULL; + objectName.pathName[0] = '\0'; } rc = (int)XBSAMarkObjectInactive(info->bsaHandle, &objectName); diff -Nru openafs-1.6.18.3/src/butc/butc_xbsa.h openafs-1.6.20/src/butc/butc_xbsa.h --- openafs-1.6.18.3/src/butc/butc_xbsa.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/butc_xbsa.h 2016-11-30 20:06:42.000000000 +0000 @@ -72,7 +72,11 @@ */ struct butx_transactionInfo { ApiVersion apiVersion; +#ifdef NEW_XBSA + long bsaHandle; +#else u_long bsaHandle; +#endif afs_int32 serverType; /* Type and flags */ afs_int32 maxObjects; /* max objects/transaction */ afs_int32 numObjects; /* objects in current trans */ diff -Nru openafs-1.6.18.3/src/butc/dump.c openafs-1.6.20/src/butc/dump.c --- openafs-1.6.18.3/src/butc/dump.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/dump.c 2016-11-30 20:06:42.000000000 +0000 @@ -644,7 +644,7 @@ hostVolumeHeader.contd = 0; volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)buffer); - rc = xbsa_WriteObjectData(&butxInfo, (struct volumeHeader *)buffer, + rc = xbsa_WriteObjectData(&butxInfo, buffer, sizeof(struct volumeHeader), &bytesWritten); if (rc != XBSA_SUCCESS) { ErrorLog(1, taskId, rc, 0, @@ -657,7 +657,7 @@ bytesWritten = sizeof(struct volumeHeader); if (bytesWritten != sizeof(struct volumeHeader)) { ErrorLog(1, taskId, rc, 0, - "The size of VolumeHeader written (%d) does not equal its actual size (%d)\n", + "The size of VolumeHeader written (%d) does not equal its actual size (%" AFS_SIZET_FMT ")\n", bytesWritten, sizeof(struct volumeHeader)); ERROR_EXIT(TC_INTERNALERROR); } @@ -706,7 +706,7 @@ hostVolumeHeader.contd = 0; hostVolumeHeader.magic = TC_VOLENDMAGIC; hostVolumeHeader.endTime = time(0); - volumeHeader_hton(&hostVolumeHeader, &buffer[bytesread]); + volumeHeader_hton(&hostVolumeHeader, (struct volumeHeader *)&buffer[bytesread]); bytesread += sizeof(hostVolumeHeader); /* End the dump and transaction with the volserver. We end it now, before @@ -2058,13 +2058,13 @@ extern struct udbHandleS udbHandle; extern struct deviceSyncNode *deviceLatch; + dumpid = ptr->dumpID; + taskId = ptr->taskId; /* Get task Id */ + setStatus(taskId, DRIVE_WAIT); EnterDeviceQueue(deviceLatch); clearStatus(taskId, DRIVE_WAIT); - dumpid = ptr->dumpID; - taskId = ptr->taskId; /* Get task Id */ - printf("\n\n"); TapeLog(2, taskId, 0, 0, "Delete Dump %u\n", dumpid); @@ -2222,6 +2222,6 @@ code = BUTX_DELETENOVOL; setStatus(taskId, TASK_ERROR); } - return (void *)(code); + return (void *)(uintptr_t)(code); } #endif diff -Nru openafs-1.6.18.3/src/butc/lwps.c openafs-1.6.20/src/butc/lwps.c --- openafs-1.6.18.3/src/butc/lwps.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/lwps.c 2016-11-30 20:06:42.000000000 +0000 @@ -1121,15 +1121,12 @@ afs_int32 headBytes, tailBytes, w; afs_int32 taskId; struct volumeHeader volTrailer; - afs_int32 vtsize = 0; int found; struct dumpNode *nodePtr; - struct tc_restoreDesc *Restore; afs_int32 bytesRead, tbuffersize, endData = 0; char *buffer = (char *)bufferBlock, tbuffer[256]; nodePtr = rparamsPtr->nodePtr; - Restore = nodePtr->restores; taskId = nodePtr->taskID; /* Read the volume fragment one block at a time until diff -Nru openafs-1.6.18.3/src/butc/tcmain.c openafs-1.6.20/src/butc/tcmain.c --- openafs-1.6.18.3/src/butc/tcmain.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butc/tcmain.c 2016-11-30 20:06:42.000000000 +0000 @@ -56,6 +56,7 @@ #define XBSA_TCMAIN #include "butc_xbsa.h" #include "butc_prototypes.h" +#include "butc_internal.h" #include #include diff -Nru openafs-1.6.18.3/src/butm/butm_prototypes.h openafs-1.6.20/src/butm/butm_prototypes.h --- openafs-1.6.18.3/src/butm/butm_prototypes.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/butm/butm_prototypes.h 2016-11-30 20:06:42.000000000 +0000 @@ -11,6 +11,7 @@ /* file_tm.c */ +extern void incSize(struct butm_tapeInfo *info, afs_uint32 dataSize); extern afs_int32 SeekFile(struct butm_tapeInfo *, int); extern afs_int32 butm_file_Instantiate(struct butm_tapeInfo *, struct tapeConfig *); diff -Nru openafs-1.6.18.3/src/cf/osconf.m4 openafs-1.6.20/src/cf/osconf.m4 --- openafs-1.6.18.3/src/cf/osconf.m4 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/cf/osconf.m4 2016-11-30 20:06:42.000000000 +0000 @@ -796,7 +796,7 @@ fi CFLAGS_NOERROR= -CFLAGS_NOSTRICT= +CFLAGS_NOSTRICT=-fno-strict-aliasing CFLAGS_NOUNUSED= CFLAGS_NOOLDSTYLE= @@ -808,10 +808,11 @@ XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith" if test "x$enable_checking" != "xall"; then CFLAGS_NOERROR="-Wno-error" - CFLAGS_NOSTRICT="-fno-strict-aliasing" CFLAGS_NOUNUSED="-Wno-unused" CFLAGS_NOOLDSTYLE="-Wno-old-style-definition" AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode]) + else + CFLAGS_NOSTRICT= fi fi fi diff -Nru openafs-1.6.18.3/src/config/NTMakefile.amd64_w2k openafs-1.6.20/src/config/NTMakefile.amd64_w2k --- openafs-1.6.18.3/src/config/NTMakefile.amd64_w2k 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/config/NTMakefile.amd64_w2k 2016-11-30 20:06:42.000000000 +0000 @@ -90,7 +90,7 @@ AFSPRODUCT_VER_MINOR=6 !ENDIF !IF !DEFINED(AFSPRODUCT_VER_PATCH) -AFSPRODUCT_VER_PATCH=1804 +AFSPRODUCT_VER_PATCH=2000 !ENDIF !IF !DEFINED(AFSPRODUCT_VER_BUILD) AFSPRODUCT_VER_BUILD=0 diff -Nru openafs-1.6.18.3/src/config/NTMakefile.i386_nt40 openafs-1.6.20/src/config/NTMakefile.i386_nt40 --- openafs-1.6.18.3/src/config/NTMakefile.i386_nt40 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/config/NTMakefile.i386_nt40 2016-11-30 20:06:42.000000000 +0000 @@ -90,7 +90,7 @@ AFSPRODUCT_VER_MINOR=6 !ENDIF !IF !DEFINED(AFSPRODUCT_VER_PATCH) -AFSPRODUCT_VER_PATCH=1804 +AFSPRODUCT_VER_PATCH=2000 !ENDIF !IF !DEFINED(AFSPRODUCT_VER_BUILD) AFSPRODUCT_VER_BUILD=0 diff -Nru openafs-1.6.18.3/src/config/NTMakefile.i386_w2k openafs-1.6.20/src/config/NTMakefile.i386_w2k --- openafs-1.6.18.3/src/config/NTMakefile.i386_w2k 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/config/NTMakefile.i386_w2k 2016-11-30 20:06:42.000000000 +0000 @@ -94,7 +94,7 @@ AFSPRODUCT_VER_MINOR=6 !ENDIF !IF !DEFINED(AFSPRODUCT_VER_PATCH) -AFSPRODUCT_VER_PATCH=1804 +AFSPRODUCT_VER_PATCH=2000 !ENDIF !IF !DEFINED(AFSPRODUCT_VER_BUILD) AFSPRODUCT_VER_BUILD=0 diff -Nru openafs-1.6.18.3/src/config/stds.h openafs-1.6.20/src/config/stds.h --- openafs-1.6.18.3/src/config/stds.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/config/stds.h 2016-11-30 20:06:42.000000000 +0000 @@ -217,7 +217,7 @@ } else if ((n) >= 2*s) { /*Shift off all bits*/ \ (a).high = (a).low = 0; \ } else if ((n) < s) { /*Part of low shifted into high*/ \ - (a).high = ((a).high<<(n)) | (((a).low>>(s-(n))) & (1<<(n))-1); \ + (a).high = ((a).high<<(n)) | (((a).low>>(s-(n))) & ((1<<(n))-1)); \ (a).low = (a).low << (n); \ } else if ((n) >= s) { /*All of low shifted into high plus some*/ \ (a).high = (a).low << ((n)-s); \ diff -Nru openafs-1.6.18.3/src/dir/buffer.c openafs-1.6.20/src/dir/buffer.c --- openafs-1.6.18.3/src/dir/buffer.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/dir/buffer.c 2016-11-30 20:06:42.000000000 +0000 @@ -11,6 +11,7 @@ #include +#include #include #include @@ -449,7 +450,9 @@ } ObtainWriteLock(&tb->lock); tb->lockers++; + memset(tb->data, 0, BUFFER_PAGE_SIZE); /* don't leak other people's dirs */ ReleaseWriteLock(&afs_bufferLock); ReleaseWriteLock(&tb->lock); + return tb->data; } diff -Nru openafs-1.6.18.3/src/dir/dir.c openafs-1.6.20/src/dir/dir.c --- openafs-1.6.18.3/src/dir/dir.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/dir/dir.c 2016-11-30 20:06:42.000000000 +0000 @@ -206,7 +206,9 @@ DRelease(previtem, 1); index = DVOffset(firstitem) / 32; nitems = NameBlobs(firstitem->name); - DRelease(firstitem, 0); + /* Clear entire DirEntry and any DirXEntry extensions */ + memset(firstitem, 0, nitems * sizeof(*firstitem)); + DRelease(firstitem, 1); FreeBlobs(dir, index, nitems); return 0; } diff -Nru openafs-1.6.18.3/src/rx/rx_kernel.h openafs-1.6.20/src/rx/rx_kernel.h --- openafs-1.6.18.3/src/rx/rx_kernel.h 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/rx/rx_kernel.h 2016-11-30 20:06:42.000000000 +0000 @@ -38,7 +38,11 @@ extern int osi_utoa(char *buf, size_t len, unsigned long val); #define osi_Assert(exp) (void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0)) -#define osi_Msg printf)( +#ifdef AFS_LINUX20_ENV +# define osi_Msg printk)( +#else +# define osi_Msg printf)( +#endif #define osi_VMsg vprintf)( #define osi_YieldIfPossible() diff -Nru openafs-1.6.18.3/src/ubik/recovery.c openafs-1.6.20/src/ubik/recovery.c --- openafs-1.6.18.3/src/ubik/recovery.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/ubik/recovery.c 2016-11-30 20:06:42.000000000 +0000 @@ -519,6 +519,7 @@ * most current database, then go find the most current db. */ if (!(urecovery_state & UBIK_RECFOUNDDB)) { + int okcalls = 0; bestServer = (struct ubik_server *)0; bestDBVersion.epoch = 0; bestDBVersion.counter = 0; @@ -529,6 +530,7 @@ continue; code = DISK_GetVersion(ts->disk_rxcid, &ts->version); if (code == 0) { + okcalls++; /* perhaps this is the best version */ if (vcmp(ts->version, bestDBVersion) > 0) { /* new best version */ @@ -537,22 +539,33 @@ } } } - /* take into consideration our version. Remember if we, - * the sync site, have the best version. Also note that - * we may need to send the best version out. - */ - if (vcmp(ubik_dbase->version, bestDBVersion) >= 0) { - bestDBVersion = ubik_dbase->version; - bestServer = (struct ubik_server *)0; - urecovery_state |= UBIK_RECHAVEDB; - } else { - /* Clear the flag only when we know we have to retrieve - * the db. Because urecovery_AllBetter() looks at it. - */ - urecovery_state &= ~UBIK_RECHAVEDB; - } - urecovery_state |= UBIK_RECFOUNDDB; - urecovery_state &= ~UBIK_RECSENTDB; + + if (okcalls + 1 >= ubik_quorum) { + /* If we've asked a majority of sites about their db version, + * then we can say with confidence that we've found the best db + * version. If we haven't contacted most sites (because + * GetVersion failed or because we already know the server is + * down), then we don't really know if we know about the best + * db version. So we can only proceed in here if 'okcalls' + * indicates we managed to contact a majority of sites. */ + + /* take into consideration our version. Remember if we, + * the sync site, have the best version. Also note that + * we may need to send the best version out. + */ + if (vcmp(ubik_dbase->version, bestDBVersion) >= 0) { + bestDBVersion = ubik_dbase->version; + bestServer = (struct ubik_server *)0; + urecovery_state |= UBIK_RECHAVEDB; + } else { + /* Clear the flag only when we know we have to retrieve + * the db. Because urecovery_AllBetter() looks at it. + */ + urecovery_state &= ~UBIK_RECHAVEDB; + } + urecovery_state |= UBIK_RECFOUNDDB; + urecovery_state &= ~UBIK_RECSENTDB; + } } #if defined(UBIK_PAUSE) /* it's not possible for UBIK_RECFOUNDDB not to be set here. diff -Nru openafs-1.6.18.3/src/ubik/ubik.c openafs-1.6.20/src/ubik/ubik.c --- openafs-1.6.18.3/src/ubik/ubik.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/ubik/ubik.c 2016-11-30 20:06:42.000000000 +0000 @@ -146,7 +146,7 @@ if (okcalls + 1 >= ubik_quorum) return 0; else - return rcode; + return (rcode != 0) ? rcode : UNOQUORUM; } afs_int32 @@ -185,7 +185,7 @@ if (okcalls + 1 >= ubik_quorum) return 0; else - return rcode; + return (rcode != 0) ? rcode : UNOQUORUM; } afs_int32 @@ -223,7 +223,7 @@ if (okcalls + 1 >= ubik_quorum) return 0; else - return rcode; + return (rcode != 0) ? rcode : UNOQUORUM; } afs_int32 @@ -261,7 +261,7 @@ if (okcalls + 1 >= ubik_quorum) return 0; else - return rcode; + return (rcode != 0) ? rcode : UNOQUORUM; } afs_int32 @@ -330,7 +330,7 @@ if (okcalls + 1 >= ubik_quorum) return 0; else - return rcode; + return (rcode != 0) ? rcode : UNOQUORUM; } afs_int32 @@ -370,7 +370,7 @@ if (okcalls + 1 >= ubik_quorum) return 0; else - return rcode; + return (rcode != 0) ? rcode : UNOQUORUM; } /*! diff -Nru openafs-1.6.18.3/src/venus/fs.c openafs-1.6.20/src/venus/fs.c --- openafs-1.6.18.3/src/venus/fs.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/venus/fs.c 2016-11-30 20:06:42.000000000 +0000 @@ -3305,10 +3305,10 @@ } in->offset = out->next_offset; - } while (out->next_offset > 0); - - if (blob.out != space) - free(blob.out); + if (blob.out != space) { + free(blob.out); + } + } while (in->offset > 0); return 0; } diff -Nru openafs-1.6.18.3/src/vol/salvaged.c openafs-1.6.20/src/vol/salvaged.c --- openafs-1.6.18.3/src/vol/salvaged.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/src/vol/salvaged.c 2016-11-30 20:06:42.000000000 +0000 @@ -206,6 +206,8 @@ OKToZap = 1; if (as->parms[6].items) /* -rootinodes */ ShowRootFiles = 1; + if (as->parms[7].items) /* -salvagedirs */ + RebuildDirs = 1; if (as->parms[8].items) /* -ForceReads */ forceR = 1; if ((ti = as->parms[9].items)) { /* -Parallel # */ diff -Nru openafs-1.6.18.3/tests/util/exec-alt-t.c openafs-1.6.20/tests/util/exec-alt-t.c --- openafs-1.6.18.3/tests/util/exec-alt-t.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/tests/util/exec-alt-t.c 2016-11-30 20:06:42.000000000 +0000 @@ -24,6 +24,7 @@ #define FAILSTR "exec test failure\n" #define ARGSTRING "teststring" +#define PSTR(s) ((s) != NULL ? (s) : "(null)") static struct exec_test { const char *prefix; /* program prefix to run */ @@ -196,7 +197,7 @@ nBytes = read(fds[0], buf, sizeof(buf)-1); is_int(result_len, nBytes, "child output size for prefix=%s, suffix=%s", - t->prefix, t->suffix); + PSTR(t->prefix), PSTR(t->suffix)); if (nBytes < 0) { skip("read() failed; cannot test read buffer"); @@ -206,7 +207,7 @@ is_string(result, buf, "child output for prefix=%s, suffix=%s", - t->prefix, t->suffix); + PSTR(t->prefix), PSTR(t->suffix)); } if (close(fds[0])) { @@ -225,12 +226,12 @@ } ok(WIFEXITED(status), "child exited for prefix=%s, suffix=%s", - t->prefix, t->suffix); + PSTR(t->prefix), PSTR(t->suffix)); if (WIFEXITED(status)) { is_int(0, WEXITSTATUS(status), "child exit code for prefix=%s, suffix=%s", - t->prefix, t->suffix); + PSTR(t->prefix), PSTR(t->suffix)); } else { skip("!WIFEXITED(status) (status=%d), cannot check exit code", status); diff -Nru openafs-1.6.18.3/tests/util/ktime-t.c openafs-1.6.20/tests/util/ktime-t.c --- openafs-1.6.18.3/tests/util/ktime-t.c 2016-08-03 14:45:27.000000000 +0000 +++ openafs-1.6.20/tests/util/ktime-t.c 2016-11-30 20:06:42.000000000 +0000 @@ -66,7 +66,6 @@ { long code; afs_int32 temp; - int errors; time_t t; struct testTime *tt; @@ -74,9 +73,8 @@ /* should do timezone and daylight savings time correction so this program * work in other than EST */ - putenv("TZ=EST"); + putenv("TZ=EST+5"); - errors = 0; for (tt = testTimes; tt->time; tt++) { temp = 0; code = ktime_DateToLong(tt->time, &temp);